Submission #1204737


Source Code Expand

import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.string;


void main() {
    auto T = readln.chomp.to!int;
    while(T--) {
        auto S = readln.chomp;
        auto N = S.length.to!int;
        auto ans = 0;
        auto p = 0;
        while (p < N-4) {
            if (S[p..p+5] == "tokyo" || S[p..p+5] == "kyoto") {
                ans += 1;
                p += 5;
            }
            else {
                p += 1;
            }
        }
        ans.writeln;
    }
}

Submission Info

Submission Time
Task A - 東京都
User nebukuro09
Language D (DMD64 v2.070.1)
Score 100
Code Size 645 Byte
Status AC
Exec Time 1 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 1 ms 256 KB
20_noised_tokyoto.txt AC 1 ms 256 KB
99_teuchi.txt AC 1 ms 256 KB