Submission #33963

#TimeUsernameProblemLanguageResultExecution timeMemory
33963mohammad_kilaniPalindromes (APIO14_palindrome)C++14
0 / 100
409 ms131072 KiB
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define oo 2000000000 const int N = 100010; unordered_map <string,int> mp; char s[N]; int main() { //freopen("in.txt","r",stdin); scanf("%s",s); int n = strlen(s); long long ans = 0 ; for(int i=0;i<n;i++){ string s; for(int j=i;j<n;j++){ s+=i; int cur = ++mp[s]; if(ans < (long long)cur * (j - i + 1)){ ans = (long long) cur * (j - i + 1); } } } cout << ans << endl; return 0; }

Compilation message (stderr)

palindrome.cpp: In function 'int main()':
palindrome.cpp:10:15: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%s",s);
               ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...