Submission #2414490


Source Code Expand

t = int(input())
anslist = []
for i in range(t):
    s = input()
    ans = 0
    for j in range(len(s)+1):
        #print(s[:j])
        if s[:j].find('tokyo')!=-1:
            s = s[:j].replace('tokyo','xxxxx')+s[j:]
            ans += 1
        if s[:j].find('kyoto')!=-1:
            s = s[:j].replace('kyoto', 'xxxxx')+s[j:]
            ans += 1
    anslist.append(ans)

for x in anslist:
    print(x)

Submission Info

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