Submission #311616

# Submission time Handle Problem Language Result Execution time Memory
311616 2020-10-10T19:06:29 Z bigg Palindromic Partitions (CEOI17_palindromic) C++14
60 / 100
10000 ms 6088 KB
#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

palindromic.cpp: In function 'int main()':
palindromic.cpp:12:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |   for(int i = 0; i < s.length()/2; i++){
      |                  ~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 1 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 1 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 1 ms 256 KB Output is correct
8 Correct 1 ms 256 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 1 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 1 ms 256 KB Output is correct
8 Correct 1 ms 256 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
10 Correct 12 ms 384 KB Output is correct
11 Correct 9 ms 384 KB Output is correct
12 Correct 10 ms 384 KB Output is correct
13 Correct 6 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 1 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 1 ms 256 KB Output is correct
8 Correct 1 ms 256 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
10 Correct 12 ms 384 KB Output is correct
11 Correct 9 ms 384 KB Output is correct
12 Correct 10 ms 384 KB Output is correct
13 Correct 6 ms 384 KB Output is correct
14 Execution timed out 10078 ms 6088 KB Time limit exceeded
15 Halted 0 ms 0 KB -