답안 #447374

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
447374 2021-07-26T08:01:04 Z osmanallazov Palindromic Partitions (CEOI17_palindromic) C++14
60 / 100
10000 ms 4196 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<<endl;
        say=0;
        x.clear();
        y.clear();
	}
}

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++){
      |                     ~^~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 16 ms 396 KB Output is correct
11 Correct 12 ms 404 KB Output is correct
12 Correct 9 ms 204 KB Output is correct
13 Correct 4 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 16 ms 396 KB Output is correct
11 Correct 12 ms 404 KB Output is correct
12 Correct 9 ms 204 KB Output is correct
13 Correct 4 ms 204 KB Output is correct
14 Execution timed out 10082 ms 4196 KB Time limit exceeded
15 Halted 0 ms 0 KB -