Submission #447362

# Submission time Handle Problem Language Result Execution time Memory
447362 2021-07-26T07:19:28 Z fuad27 Palindromic Partitions (CEOI17_palindromic) C++14
0 / 100
1 ms 204 KB
#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 time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -