Submission #1177554


Source Code Expand

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)
//#define INF (1LL<<59)

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

Submission Info

Submission Time
Task A - 東京都
User Yazaten
Language C++14 (GCC 5.4.1)
Score 0
Code Size 649 Byte
Status RE
Exec Time 98 ms
Memory 256 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 2 ms 256 KB
20_noised_tokyoto.txt AC 2 ms 256 KB
99_teuchi.txt RE 98 ms 256 KB