Submission #447362

#TimeUsernameProblemLanguageResultExecution timeMemory
447362fuad27Palindromic Partitions (CEOI17_palindromic)C++14
0 / 100
1 ms204 KiB
#include<bits/stdc++.h> using namespace std; int main () { int t; cin >> t; while(t--) { string s; cin >> s; int ans = 0, n = s.length(); string l = "", r = ""; for(int i = 0;i<n/2;i++) { l += s[i]; r = s[n-i-1] + r; if(l == r){ l = r = ""; ans+=2; } } if(s.size() > 0 or n%2 == 1)ans++; cout<<ans<<endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...