Submission #918038

#TimeUsernameProblemLanguageResultExecution timeMemory
918038ezzzayPalindromes (APIO14_palindrome)C++14
23 / 100
1083 ms131072 KiB
#include<bits/stdc++.h> using namespace std; #define ff first #define ss second map<string,int>mp; bool fun(string s){ int n=s.size(); for(int i=0;i<n;i++){ if(s[i]!=s[n-i-1])return 0; } return 1; } signed main(){ string s; cin>>s; int n=s.size(); int ans=0; for(int i=0;i<n;i++){ for(int j=i;j<n;j++){ string p= s.substr(i,j-i+1); if(fun(p)){ mp[p]++; } } } for(auto it=mp.begin();it!=mp.end();it++){ string g=it->ff; int h=g.size(); ans=max(ans,h * it->ss); } cout<<ans; }
#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...