Submission #5245994


Source Code Expand

T = int(input())
s_list = []
for _ in range(T):
    s_list.append(input())

for s in s_list:
    cnt = 0
    while True:
        place_tokyo = s.find("tokyo")
        place_kyoto = s.find("kyoto")
        if place_tokyo == -1 and place_kyoto == -1:
            print(cnt)
            break
        elif place_tokyo>=0 and place_kyoto>=0:
            cnt += 1
            s = s[min(place_tokyo,place_kyoto)+5:]
        else:
            cnt += 1
            s = s[max(place_tokyo,place_kyoto)+5:]

Submission Info

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