제출 #957304

#제출 시각아이디문제언어결과실행 시간메모리
957304vjudge1회문 (APIO14_palindrome)C++14
8 / 100
1095 ms996 KiB
#include<bits/stdc++.h> using namespace std; int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); string s; cin >> s; int ans=0; int n=s.size(); for (int i=0; i<n; ++i) for (int j=i; j<n; ++j){ string t=s.substr(i, j-i+1); string rt(t.rbegin(), t.rend()); if (t!=rt) continue; int cnt=0; for (int k=0; k+j-i<n; ++k) if (s.substr(k, j-i+1)==t) ++cnt; ans=max(ans, (j-i+1)*cnt); } cout << ans; return 0; }
#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...