Submission #532955


Source Code Expand

# -*- coding: utf-8 -*-
import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll

T = int(raw_input())
for loop in xrange(T):
    s = raw_input()
    ans = i = 0
    while i + 5 <= len(s):
        if s[i:i + 5] == "kyoto":
            ans += 1
            i += 5
        elif s[i:i + 5] == "tokyo":
            ans += 1
            i += 5
        else:
            i += 1
    print ans

Submission Info

Submission Time
Task A - 東京都
User roiti
Language Python (2.7.3)
Score 100
Code Size 429 Byte
Status AC
Exec Time 96 ms
Memory 5188 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 96 ms 5188 KB
20_noised_tokyoto.txt AC 93 ms 4872 KB
99_teuchi.txt AC 82 ms 4940 KB