Submission #447372

# Submission time Handle Problem Language Result Execution time Memory
447372 2021-07-26T07:54:31 Z osmanallazov Palindromic Partitions (CEOI17_palindromic) C++14
0 / 100
1 ms 204 KB
#include <bits/stdc++.h>
using namespace std;
int main() {
	int t,say=0;
	cin>>t;
	string s,x,y;
	while(t--){
        cin>>s;
        for(int i=0;i<s.length()/2;i++){
            x=x+s[i];
            y=s[s.length()-1-i]+y;
            if(x==y){
                say++;
                say++;
                x.clear();
                y.clear();
            }
        }
        if(s.length()%2==1 || x.length()>0){
            say++;
        }
        cout<<say;
        say=0;
	}
}

Compilation message

palindromic.cpp: In function 'int main()':
palindromic.cpp:9:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |         for(int i=0;i<s.length()/2;i++){
      |                     ~^~~~~~~~~~~~~
# 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 -