Submission #2147991


Source Code Expand

import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {

		Scanner in = new Scanner(System.in);
		int t = in.nextInt();
		for (int i = 0; i < t; i++) {
			int count = 0;
			String ins = in.next();
			for (int j = 0; j <= ins.length() - 5; j++) {
				String insmoji = ins.substring(j, j+5);
				if (insmoji.equals("kyoto") || insmoji.equals("tokyo")) {
					count++;
					j += 5;
				}
			}
			System.out.println(count);
		}

	}

}

Submission Info

Submission Time
Task A - 東京都
User tutuz
Language Java8 (OpenJDK 1.8.0)
Score 0
Code Size 539 Byte
Status WA
Exec Time 129 ms
Memory 22612 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
WA × 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 WA 129 ms 22612 KB
20_noised_tokyoto.txt WA 116 ms 22228 KB
99_teuchi.txt WA 106 ms 21204 KB