Submission #2227486


Source Code Expand

def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
n=i1()
for i in range(n):
 s=input()
 x=[]
 for i in range(len(s)-4):
  ss=s[i:i+5]
  if ss=="kyoto" or ss=="tokyo":
    x.append([i,i+3])

 x.sort(key=lambda x:x[1])
 z=0
 if len(x):
  y=x[0][1]
  z+=1
  for i in range(1,len(x)):
   if y<x[i][0]:
      z+=1
      y=x[i][1]
 print(z)

Submission Info

Submission Time
Task A - 東京都
User tacloth
Language PyPy3 (2.4.0)
Score 100
Code Size 389 Byte
Status AC
Exec Time 186 ms
Memory 39408 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 184 ms 39408 KB
20_noised_tokyoto.txt AC 186 ms 39152 KB
99_teuchi.txt AC 180 ms 38512 KB