Submission #711245


Source Code Expand

#include<iostream>
using namespace std;

int t;
char s[100][101];

int main(){
	int st=0;
	int co=0;
	int x=0;
	cin >> t;
	for (int i = 0; i < t; i++)
		cin >> s[i];
	for (int i = 0; i < t; i++) {
		if (x == 1) {
			cout << co<<endl;
			st = 0;
			co = 0;
		}
		x = 1;
		for (int j = 0; j < 100 && s[j] != 0; j++)
			if (st != -2 && s[i][j] == 'k')
				st=1;
			else if (st != 3 && s[i][j] == 't')
				st = -1;
			else if (st == 1 && s[i][j] == 'y')
				st++;
			else if (st == 2 && s[i][j] == 'o')
				st++;
			else if (st == 3 && s[i][j] == 't')
				st++;
			else if (st == 4 && s[i][j] == 'o') {
				st = 0;
				co++;
			}
			else if (st == -1 && s[i][j] == 'o')
				st--;
			else if (st == -2 && s[i][j] == 'k')
				st--;
			else if (st == -3 && s[i][j] == 'y')
				st--;
			else if (st == -4 && s[i][j] == 'o') {
				st = 0;
				co++;
			}
			else
				st = 0;
	}
	cout << co << endl;
	return 0;
				

}

Submission Info

Submission Time
Task A - 東京都
User nikutto
Language C++ (GCC 4.9.2)
Score 100
Code Size 959 Byte
Status AC
Exec Time 27 ms
Memory 920 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 27 ms 804 KB
20_noised_tokyoto.txt AC 26 ms 804 KB
99_teuchi.txt AC 26 ms 920 KB