# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
107878 | 2019-04-26T05:58:07 Z | SamAnd | Palindromes (APIO14_palindrome) | C++17 | 1000 ms | 512 KB |
#include <bits/stdc++.h> using namespace std; const int N = 102; int n; char a[N]; int main() { cin >> a; n = strlen(a); int ans = 0; for (int l = 0; l < n; ++l) { for (int r = l; r < n; ++r) { bool z = true; for (int i = l, j = r; i <= r; ++i, --j) { if (a[i] != a[j]) { z = false; break; } } if (!z) continue; int q = 0; for (int ll = 0; ll < n - (l - r + 1); ++ll) { int rr = ll + (l - r + 1) - 1; z = true; for (int i = l, j = ll; i <= r; ++i, ++j) { if (a[i] != a[j]) { z = false; break; } } if (z) ++q; } ans = max(ans, (r - l + 1) * q); } } cout << ans << endl; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Incorrect | 2 ms | 384 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1056 ms | 256 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 384 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 512 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 384 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |