# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
967414 | 2024-04-22T05:14:45 Z | Halym2007 | Palindromes (APIO14_palindrome) | C++17 | 2 ms | 348 KB |
#include <bits/stdc++.h> using namespace std; #define ll long long #define sz size() #define ff first #define ss second const int N = 1e5 + 5; map <string, int> m; string s; int n, jog; int main () { freopen ("polindrome.in", "r", stdin); freopen ("polindrome.out", "w", stdout); // freopen ("input.txt", "r", stdin); ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin >> s; int n = (int)s.sz; string t; s = " " + s; for (int i = 1; i <= n; ++i) { t = ""; for (int j = i; j <= n; ++j) { t += s[j]; bool tr = 0; for (int k = 0; k < (int)t.sz / 2; ++k) { if (t[i] != t[(int)t.sz - i - 1]) { tr = 1; break; } } if (!tr) { m[t]++; } } } for (auto i : m) { int x = (int)i.ff.size(); x *= m[i.ff]; jog = max (jog, x); } cout << jog; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |