# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
47999 | E869120 | Palindromes (APIO14_palindrome) | C++14 | 1102 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 <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
bool pal(string S) {
string T = S; reverse(T.begin(), T.end());
if (S == T) return true;
return false;
}
string S; vector<string>A; map<string, int>M; int maxn = 0;
int main() {
cin >> S;
for (int i = 0; i < S.size(); i++) {
for (int j = i; j < S.size(); j++) {
string G = S.substr(i, j - i + 1); if (pal(G) == false) continue;
A.push_back(G); M[G] += G.size();
}
}
for (int i = 0; i < A.size(); i++) maxn = max(maxn, M[A[i]]);
cout << maxn << endl;
return 0;
}
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... |