Submission #2635255


Source Code Expand

#include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define mp make_pair
#define fi first
#define sc second
ll t;
int main(){
	cin >> t;
	REP(aaa,t) {
		string s;
		cin >> s;

		ll cou = 0;
		REP(i,s.size() - 4) {
			string c = s.substr(i,5);

			if(c == "tokyo" ||c == "kyoto") {
				cou++;
				i += 4;
			}
		}
		cout << cou << endl;
	}
	return 0;
}

Submission Info

Submission Time
Task A - 東京都
User kyawakyawa
Language C++14 (GCC 5.4.1)
Score 0
Code Size 712 Byte
Status RE
Exec Time 100 ms
Memory 384 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 100 ms 384 KB