# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
23585 | Hassoony | Palindromes (APIO14_palindrome) | C++14 | 1000 ms | 131072 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
컴파일 시 표준 에러 (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... |