# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
311616 | bigg | Palindromic Partitions (CEOI17_palindromic) | C++14 | 10078 ms | 6088 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
string s;
int main(){
int t;
cin >> t;
while(t--){
cin >> s;
int ans = 0;
string esq = "";
string dir = "";
for(int i = 0; i < s.length()/2; i++){
esq.push_back(s[i]);
dir = (s[s.length()-i-1]) + dir;
if(esq == dir){
esq.clear(), dir.clear();
ans += 2;
}
}
if(s.length()%2 || esq.length())ans++;
cout << ans << endl;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |