Submission #532971


Source Code Expand

#include <bits/stdc++.h>

#define all(a)  (a).begin(),(a).end()
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define exist(s,e) ((s).find(e)!=(s).end())
#define pb push_back
#define range(i,a,b) for(int i=(a),inc=((b)-(a))?((b)-(a))/abs((b)-(a)):0;(i)!=(b);(i)+=inc)
#define rep(i,n)  range(i,0,n)
#define dump(x)  cerr << #x << " = " << (x) << endl;

using namespace std;

typedef vector<int> vi;
typedef long long ll;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 29;

random_device rd;
mt19937 mt(rd());
//uniform_int_distribution<int> dice(1,6);
//uniform_real_distribution<double> score(0.0,10.0);

int main(void){
	int t;
	cin >> t;
	rep(loop,t){
		string s;
		cin >> s;
		int ans=0;
		int n=s.size();
		rep(i,n-4){
			if(s.substr(i,5)=="kyoto"){
				ans++;
				rep(j,5) s[i+j]=' ';
			}
			if(s.substr(i,5)=="tokyo"){
				ans++;
				rep(j,5) s[i+j]=' ';
			}
		}
		cout << ans << endl;
	}
	return 0;
}

Submission Info

Submission Time
Task A - 東京都
User Hec
Language C++11 (GCC 4.9.2)
Score 0
Code Size 1013 Byte
Status RE
Exec Time 285 ms
Memory 816 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 32 ms 796 KB
20_noised_tokyoto.txt AC 30 ms 808 KB
99_teuchi.txt RE 285 ms 816 KB