Submission #447372

#TimeUsernameProblemLanguageResultExecution timeMemory
447372osmanallazovPalindromic Partitions (CEOI17_palindromic)C++14
0 / 100
1 ms204 KiB
#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 (stderr)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...