Submission #1112629


Source Code Expand

#include <bits/stdc++.h>
using namespace std;

int main()
{
	int T;
	cin >> T;
	string S;
	while (T--) {
		cin >> S;
		int res = 0;
		for (int i = 0; i + 4 < S.size(); i++) {
			if (S.substr(i, 5) == "kyoto") {
				res++;
				i += 4;
			} else if (S.substr(i, 5) == "tokyo") {
				res++;
				i += 4;
			}
		}
		cout << res << endl;
	}
	return 0;
}

Submission Info

Submission Time
Task A - 東京都
User kazuma
Language C++14 (GCC 5.4.1)
Score 100
Code Size 372 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