Submission #2968003


Source Code Expand

T = int(input())
S = [ input() for _ in range(T)]
def cnt(K):
    L = len(K)
    if L < 5:
        return 0
    else:
        i = 0
        ans = 0
        while i <= L-5:
            if K[i:i+5] == 'kyoto' or K[i:i+5] == 'tokyo':
                i += 5
                ans += 1
            else:
                i += 1
        return ans
for j in range(T):
    print(cnt(S[j]))

Submission Info

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