# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
716774 | vjudge1 | Palindromes (APIO14_palindrome) | C++17 | 1092 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>
using namespace std;
typedef long long ll;
const int maxn = 5e5 + 100;
const int mod = (int)1e9+7;
int n;
int main() {
ios_base::sync_with_stdio(false);
string s;
cin >> s;
n = s.size();
map<string, int> m;
for(int i = 0; i < n; i++) {
string t;
for(int j = i; j < n; j++) {
t += s[j];
int bad = 0;
for(int k = 0; k < t.size(); k++) {
if(t[k] != t[t.size() - k - 1]) {
bad = 1;
break;
}
}
if(not bad) m[t]++;
}
}
int ans = 0;
for(auto [t, x] : m) {
ans = max(ans, (int)t.size() * x);
}
cout << ans << "\n";
}
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... |