Submission #1275749


Source Code Expand

#include <iostream>
#include <string>

using namespace std;

int main() {
	int t;
	int count = 0;
	string s;

	cin >> t;

	for (int i = 0; i < t; i++) {
		cin >> s;

		if (s.size() < 5) {
			cout << 0 << endl;
		}
		else {
			for (int j = 0; j < s.size() - 4; j++) {
				if (s[j] == 'k' && s[j + 1] == 'y' && s[j + 2] == 'o' && s[j + 3] == 't' && s[j + 4] == 'o') {
					count++;
					j = j + 4;
				}
				else if (s[j] == 't' && s[j + 1] == 'o' && s[j + 2] == 'k' && s[j + 3] == 'y' && s[j + 4] == 'o') {
					count++;
					j = j + 4;
				}
			}

			cout << count << endl;

			count = 0;
		}
	}
}

Submission Info

Submission Time
Task A - 東京都
User karakasa
Language C++14 (GCC 5.4.1)
Score 100
Code Size 632 Byte
Status AC
Exec Time 2 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 2 ms 256 KB
99_teuchi.txt AC 1 ms 256 KB