Submission #712973

#TimeUsernameProblemLanguageResultExecution timeMemory
712973bin9638Palindromes (APIO14_palindrome)C++17
0 / 100
1081 ms1116 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define N 1000010 #define ii pair<int,int> #define fs first #define sc second #define ld double string s; int n; map<string,int>mp; int solve(int k) { int cnt=0; mp.clear(); for(int i=1;i<=n-k+1;i++) cnt=max(cnt,++mp[s.substr(i,k)]); return cnt*k; } int main() { #ifdef SKY freopen("A.inp","r",stdin); freopen("A.out","w",stdout); #endif // SKY ios::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); cin>>s; n=s.size(); s=" "+s; int res=0; for(int i=1;i<=n;i++) { int val=solve(i); res=max(res,val); } cout<<res; }
#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...