Submission #532930


Source Code Expand

#include<vector>
#include<cmath>
#include<map>
#include<cstdlib>
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<set>
#include<stack>
#include<bitset>
#include<functional>
#include<ctime>
#include<queue>
#include<deque>
#include<complex>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
int main()
{
	string s;int n;
	cin>>n;
	rep(i,n){
		cin>>s;
		int m=s.size(),ret=0,now=0;
		while(now<m){
			if(now+5<=m && (s.substr(now,5)=="tokyo" || s.substr(now,5)=="kyoto")){
				ret++;now+=5;
			}
			else now++;
		}
		cout<<ret<<endl;
	}
}

Submission Info

Submission Time
Task A - 東京都
User sky58
Language C++ (GCC 4.9.2)
Score 100
Code Size 957 Byte
Status AC
Exec Time 29 ms
Memory 924 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 29 ms 924 KB
20_noised_tokyoto.txt AC 28 ms 800 KB
99_teuchi.txt AC 24 ms 924 KB