#include <bits/stdc++.h>
using namespace std;
bool isReversed(string s) {
string u = s;
reverse(u.begin(), u.end());
return u == s;
}
int main() {
string s;
cin >> s;
int n = (int) s.length(), ans = 0;
for (int i = 0; i < n; ++i) {
string u = "";
for (int j = 0; j < n; ++j) {
u += s[j];
if (isReversed(u)) {
ans++;
}
}
}
if (isReversed(s)) {
ans++;
}
cout << ans / 3 << "\n";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
453 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1092 ms |
396 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1092 ms |
716 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1081 ms |
1124 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |