Submission #976202

#TimeUsernameProblemLanguageResultExecution timeMemory
976202JahonaliXPalindromes (APIO14_palindrome)C++17
23 / 100
1063 ms9656 KiB
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { string a; cin >> a; map<string, int> mp; int mx = 0, n = a.size(); for (int i = 0; i < n; ++i) { string b = ""; b += a[i]; mp[b]++; int l = i, r = i; while (l > 0 && r < n - 1 && a[l - 1] == a[r + 1]) { l--, r++; b = a[l] + b + a[r]; mp[b]++; } } for (int i = 0; i < n - 1; ++i) { string b = ""; int l = i + 1, r = i; while (l > 0 && r < n - 1 && a[l - 1] == a[r + 1]) { l--, r++; b = a[l] + b + a[r]; mp[b]++; } } for (auto &[x, y] : mp) { mx = max(y * (int) x.size(), mx); } cout << mx; 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...