Submission #2148000


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();
		String[] moji = new String[t];
		int[] ans = new int[t];
		for (int i = 0; i < t; i++) {
			moji[i] = in.next();
		}
		for (int i = 0; i < t; i++) {
			int count = 0;
			String ins = moji[i];
			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;
				}
			}
			ans[i] = count;
		}

		for (int i : ans) {
			System.out.println(i);
		}

	}

}

Submission Info

Submission Time
Task A - 東京都
User tutuz
Language Java8 (OpenJDK 1.8.0)
Score 0
Code Size 707 Byte
Status WA
Exec Time 122 ms
Memory 20820 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 122 ms 20048 KB
20_noised_tokyoto.txt WA 117 ms 19028 KB
99_teuchi.txt WA 104 ms 20820 KB