Submission #532941


Source Code Expand

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF 999999999
#define eps 1e-9

int main(){
    string s;
    int n;
    cin>>n;
    rep(i,n){
        cin>>s;
        int c=0;
        for(int i=0;i<s.size()-4;){
            if(s.substr(i,5)=="tokyo"||s.substr(i,5)=="kyoto"){
                c++;
                i+=5;
            }
            else i++;
        }
        cout<<c<<endl;
    }
}

    
    
    
    
    
    

Submission Info

Submission Time
Task A - 東京都
User Yazaten
Language C++ (GCC 4.9.2)
Score 0
Code Size 616 Byte
Status RE
Exec Time 281 ms
Memory 1136 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 2
RE × 1
Set Name Test Cases
All 10_random_to_kyo.txt, 20_noised_tokyoto.txt, 99_teuchi.txt
Case Name Status Exec Time Memory
10_random_to_kyo.txt AC 30 ms 872 KB
20_noised_tokyoto.txt AC 28 ms 868 KB
99_teuchi.txt RE 281 ms 1136 KB