# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
23585 | Hassoony | Palindromes (APIO14_palindrome) | C++14 | 1000 ms | 131072 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define MEM(dp,i) memset(dp,i,sizeof(dp))
#define R return
#define F first
#define S second
#define C continue
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
const int MX=1009;
const ll mod=1e9+7;
const ll inf=(1ll<<60);
ll p[MX][MX],n;
string s;
map<string,pll>m;
int main(){
cin>>s;
n=s.size();
for(int i=0;i<n;i++){
string tmp="";
for(int j=i;j<n;j++){
tmp+=s[j];
m[tmp].F=i;
m[tmp].S++;
}
}
ll ans=0;
for(auto pp:m){
string x=pp.F;
ll i=pp.S.F,b=0;
ll k=pp.S.S;
ll y=x.size();
for(int i=0;i<y/2;i++){
if(x[i]!=x[y-i-1])b=1;
}
if(!b)ans=max(ans,y*k);
}
cout<<ans<<endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |