#include "bits/stdc++.h"
#define ll long long int
#define pb push_back
#define pii pair<int,int>
#define ff first
#define ss second
#define sz size()
const int N = 2e5 + 1;
using namespace std;
bool barla(string st){
string st1 = st;
reverse(st.begin(), st.end());
if(st == st1) return 1;
else return 0;
}
int main(){
ios::sync_with_stdio(false); cin.tie(nullptr);
//freopen("input.in", "r", stdin);
//freopen("output.out", "w", stdout);
ll ans = 0;
string s;
cin >> s;
for(int i = 0; i < (int)s.sz; i++){
string m = "";
for(int j = i; j < (int)s.sz; j++){
m += s[j];
if(barla(m)) ans++;
}
}
cout << ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1087 ms |
348 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1018 ms |
1008 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |