Submission #4009398


Source Code Expand

T = int(input())
S = [input() for i in range(T)]

Ans = []
for s in S:
    i = 0
    ans = 0
    while i <= len(s)-5:
        if s[i] == 't':
            if s[i:i+5] == 'tokyo':
                ans += 1
                i += 5
            else: i += 1
        elif s[i] == 'k':
            if s[i:i+5] == 'kyoto':
                ans += 1
                i += 5
            else: i+= 1
        else: i += 1
    Ans.append(ans)

for ans in Ans:
    print(ans)

Submission Info

Submission Time
Task A - 東京都
User tacoyama
Language Python (3.4.3)
Score 100
Code Size 479 Byte
Status AC
Exec Time 19 ms
Memory 3064 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 19 ms 3064 KB
20_noised_tokyoto.txt AC 19 ms 3064 KB
99_teuchi.txt AC 18 ms 3060 KB