Submission #532977


Source Code Expand

T = int(input())
for _ in range(T):
    s = input()
    p = 0
    ans = 0
    while p < len(s):
        p1 = s.find('tokyo', p)
        p2 = s.find('kyoto', p)
        if p1 == -1:
            p1 = len(s)
        if p2 == -1:
            p2 = len(s)
        p = min(p1, p2)
        if p == len(s):
            break
        ans += 1
        p += 5
    print(ans)

Submission Info

Submission Time
Task A - 東京都
User torimal
Language Python (3.4.2)
Score 100
Code Size 381 Byte
Status AC
Exec Time 1368 ms
Memory 7188 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 1368 ms 7188 KB
20_noised_tokyoto.txt AC 106 ms 6716 KB
99_teuchi.txt AC 103 ms 6760 KB