Submission #532942


Source Code Expand

n = input()
for _ in xrange(n):
    s = raw_input()
    l = len(s)
    dp = [0] * (l + 1)
    for u in xrange(1, l + 1):
        dp[u] = max(dp[u-1], dp[u])
        if s[u-5:u] in ['tokyo', 'kyoto']:
            dp[u] = dp[u-5] + 1
    print dp[l]

Submission Info

Submission Time
Task A - 東京都
User amylase
Language Python (2.7.3)
Score 100
Code Size 256 Byte
Status AC
Exec Time 64 ms
Memory 3380 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 64 ms 3256 KB
20_noised_tokyoto.txt AC 63 ms 3380 KB
99_teuchi.txt AC 57 ms 3372 KB