답안 #939040

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
939040 2024-03-06T04:14:37 Z vjudge1 Palindromic Partitions (CEOI17_palindromic) C++17
60 / 100
10000 ms 8488 KB
#include <bits/stdc++.h>
#define int long long
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(),x.end()
using namespace std;
signed main(){
    ios_base::sync_with_stdio();
    cin.tie(0);cout.tie(0);
    int t;
    cin>>t;
    while(t--){
        string s;
        cin>>s;
        string t=s;reverse(all(t));
        string a="",b="";
        int res=0;
        for(int i=0;i<s.size();i++){
            a+=s[i];
            b=t[i]+b;
            if(a==b){
                res++;a="";b="";
            }
        }
        cout<<res<<"\n";
    }
}
            
/*

*/
           
 
           

Compilation message

palindromic.cpp: In function 'int main()':
palindromic.cpp:19:22: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |         for(int i=0;i<s.size();i++){
      |                     ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 8 ms 604 KB Output is correct
11 Correct 6 ms 856 KB Output is correct
12 Correct 6 ms 348 KB Output is correct
13 Correct 4 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 8 ms 604 KB Output is correct
11 Correct 6 ms 856 KB Output is correct
12 Correct 6 ms 348 KB Output is correct
13 Correct 4 ms 348 KB Output is correct
14 Execution timed out 10027 ms 8488 KB Time limit exceeded
15 Halted 0 ms 0 KB -