Submission #5445108


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('tokyo')
        for z in tokyo_split:
            if z.find('tokyo')>-1:
                kyoto_split += z.split('kyoto')
    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 836 Byte
Status RE
Exec Time 17 ms
Memory 2940 KB

Judge Result

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