Submission #967434

# Submission time Handle Problem Language Result Execution time Memory
967434 2024-04-22T05:54:48 Z Halym2007 Palindromes (APIO14_palindrome) C++17
23 / 100
1000 ms 131072 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;
	for (int i = 0; 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; ++k) {
				if (t[k] != t[(int)t.sz - k - 1]) {
					tr = 1;
//					break;
				}
			}
			if (!tr) {
				m[t]++;
			}
		}
	}
	for (auto i : m) {
		int x = (int)i.ff.sz;
		int y = m[i.ff];
		jog = max (jog, x * y);
	}
	cout << jog;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 456 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 344 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 452 KB Output is correct
20 Correct 1 ms 600 KB Output is correct
21 Correct 1 ms 344 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 1 ms 348 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 0 ms 456 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 138 ms 1012 KB Output is correct
2 Correct 116 ms 544 KB Output is correct
3 Correct 156 ms 1016 KB Output is correct
4 Correct 126 ms 476 KB Output is correct
5 Correct 157 ms 856 KB Output is correct
6 Correct 156 ms 1012 KB Output is correct
7 Correct 110 ms 848 KB Output is correct
8 Correct 132 ms 856 KB Output is correct
9 Correct 112 ms 468 KB Output is correct
10 Correct 118 ms 440 KB Output is correct
11 Correct 106 ms 348 KB Output is correct
12 Correct 108 ms 592 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1095 ms 50100 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 279 ms 131072 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 279 ms 131072 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -