Submission #3885879


Source Code Expand

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define eps LDBL_EPSILON
#define moder 1000000007
#define int long long
#define ll long long
#define INF LLONG_MAX/3
#define P std::pair<int,int>
#define prique priority_queue<int,vector<int>,greater<int>>
using namespace std;
int t;
string s;
int ans;
signed main(){
	cin>>t;
	rep(i,t){
		cin>>s;
		rep(j,(int)s.size()-4){
			if(s.substr(j,5)=="tokyo"||s.substr(j,5)=="kyoto"){
				ans++;
				j+=4;
			}
		}
		cout<<ans<<endl;
		ans=0;
	}
    return 0;
}

Submission Info

Submission Time
Task A - 東京都
User kaage
Language C++14 (GCC 5.4.1)
Score 100
Code Size 545 Byte
Status AC
Exec Time 3 ms
Memory 256 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 3
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 3 ms 256 KB
99_teuchi.txt AC 2 ms 256 KB