Submission #5445124


Source Code Expand

n= int(input())
mojiretu = [input() for x in range(n)]

place = ['tokyo','kyoto']
for x in mojiretu:
    len_result = []
    tokyo_split = []
    kyoto_split = []
    if x.find('tokyo')>-1:
        tokyo_split = x.split('tokyo')
        for z in tokyo_split:
            if z.find('kyoto')>-1:
                kyoto_split += z.split('kyoto')
    len_result.append(len(kyoto_split))
    len_result.append(len(tokyo_split))
    tokyo_split = []
    kyoto_split = []
    if x.find('kyoto')>-1:
        tokyo_split = x.split('kyoto')
        for z in tokyo_split:
            if z.find('tokyo')>-1:
                kyoto_split += z.split('tokyo')
    len_result.append(len(kyoto_split))
    len_result.append(len(tokyo_split))
    if max(len_result)>0:
        print(max(len_result)-1)
    else:
        print(0)

Submission Info

Submission Time
Task A - 東京都
User asgasw
Language Python (3.4.3)
Score 0
Code Size 835 Byte
Status WA
Exec Time 18 ms
Memory 3064 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
WA × 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 WA 18 ms 3064 KB
20_noised_tokyoto.txt WA 18 ms 3064 KB
99_teuchi.txt WA 18 ms 3064 KB