Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = map(int, input().split(" "))
n = [0] * (2 * 10 ** 5 + 1)
for v in A:
    n[v] += 1
    if 2 * v > (2 * 10 ** 5 // v + 1) * v:
        continue
    for i in range(2 * v, (2 * 10 ** 5 // v + 1) * v, v):
        n[i] += 10
cnt = 0
n.pop(0)
for v in n:
    if v == 1:
        cnt += 1
print(cnt)

Fixed submission:
N = int(input())
A = list(map(int, input().split(" ")))
a_max = max(A)
cnts = [0] * (a_max + 1)
for a in A:
    v = a
    while v <= a_max:
        cnts[v] += 1
        v += a
cnt = 0
for a in A:
    if cnts[a] == 1:
        cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = sorted(list(map(int, input().split(" "))))
idx = 0
while True:
    removes = []
    v = a[idx]
    for target in a[idx:]:
        if target % v == 0:
            removes.append(target)
    removes.remove(v)
    if removes:
        if removes[0] == v:
            removes.append(v)
        for target in removes:
            a.remove(target)
    if len(a) == 0 or a[-1] == v:
        break
    idx += 1
print(len(a))

Fixed submission:
N = int(input())
A = list(map(int, input().split(" ")))
a_max = max(A)
cnts = [0] * (a_max + 1)
for a in A:
    v = a
    while v <= a_max:
        cnts[v] += 1
        v += a
cnt = 0
for a in A:
    if cnts[a] == 1:
        cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = sorted(list(map(int, input().split(" "))))
idx = 0
while True:
    removes = []
    v = a[idx]
    for target in a:
        if target % v == 0:
            removes.append(target)
    removes.remove(v)
    if removes:
        if removes[0] == v:
            removes.append(v)
        for target in removes:
            a.remove(target)
    if len(a) == 0 or a[-1] == v:
        break
    idx += 1
print(len(a))

Fixed submission:
N = int(input())
A = list(map(int, input().split(" ")))
a_max = max(A)
cnts = [0] * (a_max + 1)
for a in A:
    v = a
    while v <= a_max:
        cnts[v] += 1
        v += a
cnt = 0
for a in A:
    if cnts[a] == 1:
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
d = {"Sunny": "Cloudy", "Cloudy": "Rainy", "Rainy": "Sunny"}
print(d[s])

Fixed submission:
s = input()
d = {"Sunny": "Cloudy", "Cloudy": "Rainy", "Rainy": "Sunny"}
print(d[s])
Buggy python submission (verdict: Runtime Error):
AC = 0
WA = 0
TLE = 0
RE = 0

N = int(input())
for i in N:
  l = input()
  if l == "AC":
    AC += 1
  elif l == "WA":
    WA += 1
  elif l == "TLE":
    TLE += 1
  else:
    RE += 1
print("AC x " + str(AC)) 
print("WA x " + str(WA))
print("TLE x " + str(TLE)) 
print("RE x " + str(RE))

Fixed submission:
AC = 0
WA = 0
TLE = 0
RE = 0
 
N = int(input())
for i in range(N):
  l = input()
  if l == "AC":
    AC += 1
  elif l == "WA":
    WA += 1
  elif l == "TLE":
    TLE += 1
  else:
    RE += 1
print("AC x " + str(AC)) 
print("WA x " + str(WA))
print("TLE x " + str(TLE)) 
print("RE x " + str(RE))
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
tmp = 0
for i in range(len(S)):
  if S[i] == T[i]:
    pass:
  else:
    tmp += 1
    
    
print(tmp)
  

Fixed submission:
S = input()
T = input()
tmp = 0
for i in range(len(S)):
  if S[i] == T[i]:
    pass
  else:
    tmp += 1
    
    
print(tmp)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
summary = sum(A)
d = {}
for a in A:
  if a in d:
    d[a] += 1
  else:
    d[a] = 1
    
Q = int(input())
for _ in range(Q):
  B, C = list(map(int,input().split()))
  if B not in d:
    b = 0
  else:
    b = d[B]
  	d[B] = 0
  if C in d:
    d[C] += b
  else:
    d[C] = b
  summary = summary + b * (C - B)
  print(summary)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
summary = sum(A)
d = {}
for a in A:
  if a in d:
    d[a] += 1
  else:
    d[a] = 1
    
Q = int(input())
for _ in range(Q):
  B, C = list(map(int,input().split()))
  if B not in d:
    b = 0
  else:
    b = d[B]
    d[B] = 0
  if C in d:
    d[C] += b
  else:
    d[C] = b
  summary = summary + b * (C - B)
  print(summary)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
summary = sum(A)
d = {}
for a in A:
  if a in d:
    d[a] += 1
  else:
    d[a] = 1
    
Q = int(input())
for _ in range(Q):
  B, C = list(map(int,input().split()))
  if b in d:
    b = 0
  else:
    b = d[B]
  	d[B] = 0
  if C in d:
    d[C] += b
  else:
    d[C] = b
  summary = summary + b * (C - B)
  print(summary)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
summary = sum(A)
d = {}
for a in A:
  if a in d:
    d[a] += 1
  else:
    d[a] = 1
    
Q = int(input())
for _ in range(Q):
  B, C = list(map(int,input().split()))
  if B not in d:
    b = 0
  else:
    b = d[B]
    d[B] = 0
  if C in d:
    d[C] += b
  else:
    d[C] = b
  summary = summary + b * (C - B)
  print(summary)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
summary = sum(A)
d = {}
for a in A:
  if a in d:
    d[a] += 1
  else:
    d[a] = 1
    
Q = int(input())
for _ in range(Q):
  B, C = list(map(int,input().split()))
  b = d[B]
  d[B] = 0
  if C in d:
    d[C] += b
  else:
    d[C] = b
  summary = summary + b * (C - B)
  print(summary)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
summary = sum(A)
d = {}
for a in A:
  if a in d:
    d[a] += 1
  else:
    d[a] = 1
    
Q = int(input())
for _ in range(Q):
  B, C = list(map(int,input().split()))
  if B not in d:
    b = 0
  else:
    b = d[B]
    d[B] = 0
  if C in d:
    d[C] += b
  else:
    d[C] = b
  summary = summary + b * (C - B)
  print(summary)
Buggy python submission (verdict: Runtime Error):
INF = 10**18
N = int(input())
sum = 1
for _ in range(N):
  sum = sum*int(input())
  if sum > INF:
    print(-1)
    import sys
    sys.exit()

print(sum)

Fixed submission:
INF = 1000000000000000000
N = int(input())
flag = 1
l = list(map(int,input().split()))
if 0 in l:
  print(0)
  import sys
  sys.exit()
sum = 1
for i in l:
  sum = sum*i
  if sum > INF:
    print(-1)
    flag = 0
    break
  else:
    pass
    
if flag:
  print(sum)
Buggy python submission (verdict: Runtime Error):
A, B = list(map(int,input().split()))
print(int(A*B))

Fixed submission:
A, B = input().split()
A = int(A)
B = B.replace(".", "")
B = int(B)
AB = A*B
AB = str(AB)
AB = "00" + AB
AB = AB[:-2]
print(int(AB))
Buggy python submission (verdict: Runtime Error):
from itertools import combinations
 
N, M, X = list(map(int,input().split()))
A = []
for i in range(N):
  A.append(list(map(int,input().split())))
sum = []
subsets=[]
for i in range(len(A) + 1):
    for c in combinations(A, i):
        subsets.append(list(c))
 
for i in subsets:
  tmp = [0]*(M+1)
  if len(i) == 1:
    sum.append(i[0])
  elif len(i) == 0:
    sum.append([0]*(M+1))
  else:
    for j in i:
      tmp = list(map(lambda a,b: a + b, tmp,j))
    sum.append(tmp)
    
min_price = 999999999999999
 
for i in sum:
  t = 0
  for j in range(len(i)):
    if j==0:
      pass
    elif X > i[j]:
      t = 1
      break
  if t == 0
    min_price = min(min_price, i[0])
 
if min_price == 999999999999999:
  print(-1)
else:
  print(min_price)

Fixed submission:
from itertools import combinations
 
N, M, X = list(map(int,input().split()))
A = []
for i in range(N):
  A.append(list(map(int,input().split())))
sum = []
subsets=[]
for i in range(len(A) + 1):
    for c in combinations(A, i):
        subsets.append(list(c))
 
for i in subsets:
  tmp = [0]*(M+1)
  if len(i) == 1:
    sum.append(i[0])
  elif len(i) == 0:
    sum.append([0]*(M+1))
  else:
    for j in i:
      tmp = list(map(lambda a,b: a + b, tmp,j))
    sum.append(tmp)
    
min_price = 10000000000
 
for i in sum:
  t = 0
  for j in range(len(i)):
    if j==0:
      pass
    elif X > i[j]:
      t = 1
      break
  if t == 0:
    min_price = min(min_price, i[0])
 
if min_price == 10000000000:
  print(-1)
else:
  print(min_price)

Buggy python submission (verdict: Runtime Error):
from itertools import combinations
 
N, M, X = list(map(int,input().split()))
A = []
for i in range(N):
  A.append(list(map(int,input().split())))
sum = []
subsets=[]
for i in range(len(A) + 1):
    for c in combinations(A, i):
        subsets.append(list(c))
 
for i in subsets:
  tmp = [0]*(M+1)
  if len(i) == 1:
    sum.append(i[0])
  elif len(i) == 0:
    sum.append([0]*(M+1))
  else:
    for j in i:
      tmp = list(map(lambda a,b: a + b, tmp,j))
    sum.append(tmp)
    
min_price = 101010101010101010101010
 
for i in sum:
  t = 0
  for j in range(len(i)):
    if j==0:
      pass
    elif X > i[j]:
      t = 1
      break
  if t == 0
    min_price = min(min_price, i[0])
 
if min_price == 101010101010101010101010:
  print(-1)
else:
  print(min_price) 

Fixed submission:
from itertools import combinations
 
N, M, X = list(map(int,input().split()))
A = []
for i in range(N):
  A.append(list(map(int,input().split())))
sum = []
subsets=[]
for i in range(len(A) + 1):
    for c in combinations(A, i):
        subsets.append(list(c))
 
for i in subsets:
  tmp = [0]*(M+1)
  if len(i) == 1:
    sum.append(i[0])
  elif len(i) == 0:
    sum.append([0]*(M+1))
  else:
    for j in i:
      tmp = list(map(lambda a,b: a + b, tmp,j))
    sum.append(tmp)
    
min_price = 10000000000
 
for i in sum:
  t = 0
  for j in range(len(i)):
    if j==0:
      pass
    elif X > i[j]:
      t = 1
      break
  if t == 0:
    min_price = min(min_price, i[0])
 
if min_price == 10000000000:
  print(-1)
else:
  print(min_price)
Buggy python submission (verdict: Time Limit Exceeded):
from math import ceil #切り上げ
import numpy as np
 
def inp(): return int(input()) #一個だけ読み取り
def inpm(): return map(int,input().split()) #mapオブジェクトで呼び出し
def inpl(): return list(map(int, input().split())) #数字リストをintで
def inpls(): return list(input().split()) #リストをstrで

A,B,N = inpl()
x = 0
for i in range(0,N+1):
  if B > i:
    x = i
  else:
    break
    
print(A*x//B)

Fixed submission:
from math import ceil #切り上げ
import numpy as np
 
def inp(): return int(input()) #一個だけ読み取り
def inpm(): return map(int,input().split()) #mapオブジェクトで呼び出し
def inpl(): return list(map(int, input().split())) #数字リストをintで
def inpls(): return list(input().split()) #リストをstrで

A,B,N = inpl()
if B <= N:
  x = B-1
else:
  x = N
    
print(A*x//B)

Buggy python submission (verdict: Time Limit Exceeded):
from math import ceil #切り上げ
import numpy as np
 
def inp(): return int(input()) #一個だけ読み取り
def inpm(): return map(int,input().split()) #mapオブジェクトで呼び出し
def inpl(): return list(map(int, input().split())) #数字リストをintで
def inpls(): return list(input().split()) #リストをstrで

A,B,N = inpl()
max = -1
for i in range(0,N+1):
  if max <= (A*i)//B-A*(i//B):
    max = (A*i)//B-A*(i//B)
print(max)
  

Fixed submission:
from math import ceil #切り上げ
import numpy as np
 
def inp(): return int(input()) #一個だけ読み取り
def inpm(): return map(int,input().split()) #mapオブジェクトで呼び出し
def inpl(): return list(map(int, input().split())) #数字リストをintで
def inpls(): return list(input().split()) #リストをstrで

A,B,N = inpl()
if B <= N:
  x = B-1
else:
  x = N
    
print(A*x//B)
Buggy python submission (verdict: Runtime Error):
num = input()
ad = ""
for i in num:
  ad.append("x")
print(ad)
  

Fixed submission:
num = input()
ad = ""
for i in num:
  ad+="x"
print(ad)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = input().split(" ")
N = int(N)
K = int(K)
p = input().split(" ")
expected_list = []
max_list = []
for i in range(N):
  expected_list.append((int(p[i])+1)/2)
  
for i in range(N):
  anan = 0
  for j in range(K):
    try:
      anan += expected_list[i+j]
    except:
      pass
  max_list.append(anan)
  
print(max(max_list))

Fixed submission:
N,K = input().split(" ")
N = int(N)
K = int(K)
p = input().split(" ")
expected_list = []
max_list = []
for i in range(N):
  expected_list.append((int(p[i])+1)/2)
anan = 0
for j in range(K):
  anan += expected_list[j]
max_list.append(anan)
for i in range(N):
  if i == 0:
    continue
  anan = 0
  try:
    anan = max_list[i-1]-expected_list[i-1]+expected_list[i+K-1]
  except:
    pass
  max_list.append(anan)
  
print(max(max_list))

Buggy python submission (verdict: Time Limit Exceeded):
N,K = input().split(" ")
N = int(N)
K = int(K)
p = input().split(" ")
expected_list = []
max_list = []
for i in range(N):
  sum = int(p[i])*(int(p[i])+1)/2
  expected_list.append(float(sum/(int(p[i]))))
  
for i in range(N):
  anan = 0
  for j in range(K):
    try:
      anan += expected_list[i+j]
    except:
      pass
  max_list.append(anan)
  
print(max(max_list))
  

Fixed submission:
N,K = input().split(" ")
N = int(N)
K = int(K)
p = input().split(" ")
expected_list = []
max_list = []
for i in range(N):
  expected_list.append((int(p[i])+1)/2)
anan = 0
for j in range(K):
  anan += expected_list[j]
max_list.append(anan)
for i in range(N):
  if i == 0:
    continue
  anan = 0
  try:
    anan = max_list[i-1]-expected_list[i-1]+expected_list[i+K-1]
  except:
    pass
  max_list.append(anan)
  
print(max(max_list))

Buggy python submission (verdict: Time Limit Exceeded):
N,K = input().split(" ")
N = int(N)
K = int(K)
p = input().split(" ")
expected_list = []
max_list = []
for i in range(N):
  sum = 0
  for j in range(int(p[i])+1):
    sum += j
  expected_list.append(float(sum/(int(p[i]))))
  
for i in range(N):
  anan = 0
  for j in range(K):
    try:
      anan += expected_list[i+j]
    except:
      pass
  max_list.append(anan)

print(max(max_list))

Fixed submission:
N,K = input().split(" ")
N = int(N)
K = int(K)
p = input().split(" ")
expected_list = []
max_list = []
for i in range(N):
  expected_list.append((int(p[i])+1)/2)
anan = 0
for j in range(K):
  anan += expected_list[j]
max_list.append(anan)
for i in range(N):
  if i == 0:
    continue
  anan = 0
  try:
    anan = max_list[i-1]-expected_list[i-1]+expected_list[i+K-1]
  except:
    pass
  max_list.append(anan)
  
print(max(max_list))
Buggy python submission (verdict: Runtime Error):
a = input()
a = a.split(" ")
i = 0
while 1:
  if int(a[0])=<0:
    break
  else:
    i = i+1
    a[0]=int(a[0])-int(a[1])
    
print(i)
  

Fixed submission:
a = input()
a = a.split(" ")
i = 0
while 1:
  if int(a[0]) <= 0:
    break
  else:
    i = i+1
    a[0]=int(a[0])-int(a[1])
    
print(i)

Buggy python submission (verdict: Runtime Error):
a = input()
a = a.split(" ")
i = 0
while 1:
  if a[0]<0:
    break
  else:
    i = i+1
    a[0]=int(a[0])-int(a[1])
    
print(i)

Fixed submission:
a = input()
a = a.split(" ")
i = 0
while 1:
  if int(a[0]) <= 0:
    break
  else:
    i = i+1
    a[0]=int(a[0])-int(a[1])
    
print(i)

Buggy python submission (verdict: Runtime Error):
a = input()
a = a.split(" ")
i = 0
while 1:
  if a[0]<0:
    break
  else:
    i = i+1
 	a[0]=a[0]-a[1]
    
print(i)

Fixed submission:
a = input()
a = a.split(" ")
i = 0
while 1:
  if int(a[0]) <= 0:
    break
  else:
    i = i+1
    a[0]=int(a[0])-int(a[1])
    
print(i)

Buggy python submission (verdict: Runtime Error):
a = input()
a = a.split(" ")
i = 0
while 1:
  if a[0]<0:
    break
  else:
    i = i+1
 	b=a[0]-a[1]*i
    
print(i)

Fixed submission:
a = input()
a = a.split(" ")
i = 0
while 1:
  if int(a[0]) <= 0:
    break
  else:
    i = i+1
    a[0]=int(a[0])-int(a[1])
    
print(i)
Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
sum=0
a=int(a)
b=int(b)
 
if a>=b:
  sum+=a
  if a-1>=b:
  	sum+=a-1
  else:
    sum+=b
else:
  sum+=b
  if b-1>=a:
  	sum+=b-1
  else:
    sum+=a
    
print(sum)

Fixed submission:
import numpy as np
 
a,b=(int(x) for x in input().split())
sum=0

 
if a>=b:
  sum+=a
  if a-1>=b:
  	sum+=a-1
  else:
    sum+=b
else:
  sum+=b
  if b-1>=a:
  	sum+=b-1
  else:
    sum+=a
    
print(sum)

Buggy python submission (verdict: Runtime Error):
import numpy as np

a=input()
b=input()
sum=0

if a>=b:
  sum+=a
  if a-1>=b:
  	sum+=a-1
  else:
    sum+=b
else:
  sum+=b:
  if b-1>=a:
  	sum+=b-1
  else:
    sum+=a
    
print(sum)
  

Fixed submission:
import numpy as np
 
a,b=(int(x) for x in input().split())
sum=0

 
if a>=b:
  sum+=a
  if a-1>=b:
  	sum+=a-1
  else:
    sum+=b
else:
  sum+=b
  if b-1>=a:
  	sum+=b-1
  else:
    sum+=a
    
print(sum)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ac = wa = tle = re = 0
for i in range(n):
  m = int(input())
  if m == 'AC':
    ac += 1
  elif m == 'WA':
    wa += 1
  elif m == 'TLE':
    tle += 1
  else:
    re += 1
print('AC x', ac)
print('WA x', wa)
print('TLE x', tle)
print('RE x', re)

Fixed submission:
n = int(input())
ac = wa = tle = re = 0
for i in range(n):
  m = input()
  if m == 'AC': ac += 1
  elif m == 'WA': wa += 1
  elif m == 'TLE': tle += 1
  else: re += 1
print('AC x', ac)
print('WA x', wa)
print('TLE x', tle)
print('RE x', re)

Buggy python submission (verdict: Runtime Error):
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(n):
  m = int(input())
  if m == 'AC':
    ac += 1
  elif m == 'WA':
    wa += 1
  elif m == 'TLE':
    tle += 1
  elif m == 'RE':
    re += 1
print('AC x', ac)
print('WA x', wa)
print('TLE x', tle)
print('RE x', re)

Fixed submission:
n = int(input())
ac = wa = tle = re = 0
for i in range(n):
  m = input()
  if m == 'AC': ac += 1
  elif m == 'WA': wa += 1
  elif m == 'TLE': tle += 1
  else: re += 1
print('AC x', ac)
print('WA x', wa)
print('TLE x', tle)
print('RE x', re)
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
B = int(input())
b_5 = 0
b_7 = 0
if A == 5:
  b_5 += 1
elif A == 7:
  b_7 += 1
if B == 5:
  b_5 +=1
elif B==7:
  b_7 += 1
if C==5:
  b_5 +=1
elif C==7:
  b_7 += 1

if b_5 == 2 and b_7 == 1:
  print("YES")
else:
  print("NO")

Fixed submission:
A,B,C = map(int,input().split())
b_5 = 0
b_7 = 0
if A == 5:
  b_5 += 1
elif A == 7:
  b_7 += 1
if B == 5:
  b_5 +=1
elif B==7:
  b_7 += 1
if C==5:
  b_5 +=1
elif C==7:
  b_7 += 1

if b_5 == 2 and b_7 == 1:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
A = input()
B = input()
B = input()
b_5 =0
b_7=0
if A == 5:
  b_5 += 1
elif A == 7:
  b_7 += 1
if B == 5:
  b_5 +=1
elif B==7:
  b_7 += 1
if C==5:
  b_5 +=1
elif C==7:
  b_7 += 1

if b_5 == 2 and b_7 == 1:
  print("YES")
else:
  print("NO")


Fixed submission:
A,B,C = map(int,input().split())
b_5 = 0
b_7 = 0
if A == 5:
  b_5 += 1
elif A == 7:
  b_7 += 1
if B == 5:
  b_5 +=1
elif B==7:
  b_7 += 1
if C==5:
  b_5 +=1
elif C==7:
  b_7 += 1

if b_5 == 2 and b_7 == 1:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
d={'AC':0,'WA':0,'TLE':0,'RE':0}
for _ in range(int(input()):
	d[input()]+=1
print('AC X',d['AC'])
print('WA X',d['WA'])
print('TLE X',d['TLE'])
print('RE X',d['RE'])
               
               

Fixed submission:
d={'AC':0,'WA':0,'TLE':0,'RE':0}
for _ in range(int(input())):
	d[input()]+=1
print('AC x',d['AC'])
print('WA x',d['WA'])
print('TLE x',d['TLE'])
print('RE x',d['RE'])
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=list(map(int,input().split()))
c=0
def isfactors(n):
	for i in range(1,n//2+1):
		if n%i==0 and i in l:
			return False
	return True
for i in l:
	if l.count(i)==1 and isfactors(i):
		c+=1
print(c)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
c=0
d={}
f=[0]*(max(l)+1)
for i in l:
	if i in d:
		d[i]+=1
	else:
		d[i]=1
x=sorted(list(set(l)))
for i in x:
	if d[i]==1 and f[i]==0:
		c+=1
	for j in range(2*i,len(f),i):
		f[j]=1 

print(c)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=list(map(int,input().split()))
c=0
for i in range(n):
	for j in range(i+1,n):
		if l[j]+l[i] == j-i:
			c+=1
print(c)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
c=0
x=[]
y={}
for i in range(n):
	x.append(l[i]+i)
	if (i-l[i]) in y: 
		y[i-l[i]]+=1
	else:
		y[i-l[i]]=1
for i in x:
	if i in y :
		c+=y[i]

	
print(c)
Buggy python submission (verdict: Runtime Error):
N = int(input())

result = {}
for _ in range(N):
  s = input()
  result[s] = result.get(s, 0) + 1

print(f"AC x {result['AC']}")
print(f"WA x {result['WA']}")
print(f"TLE x {result['TLE']}")
print(f"RE x {result['RE']}")

Fixed submission:
N = int(input())

result = {}
for _ in range(N):
  s = input()
  result[s] = result.get(s, 0) + 1

print(f"AC x {result.get('AC', 0)}")
print(f"WA x {result.get('WA', 0)}")
print(f"TLE x {result.get('TLE', 0)}")
print(f"RE x {result.get('RE', 0)}")
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input())
print('Yes' if A == B == C else 'No')

Fixed submission:
A, B, C = map(int, input().split())
print('Yes' if A == B == C else 'No')
Buggy python submission (verdict: Runtime Error):
_ = input()
edges = list(int, input().split())
max_edge = max(edges)
print('Yes' if max_edge < sum(edges) - max_edge else 'No')

Fixed submission:
_ = input()
edges = list(map(int, input().split()))
max_edge = max(edges)
print('Yes' if max_edge < sum(edges) - max_edge else 'No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

ans = len(S) - 1
for i in range(len(S)):
    _ans = S.count("W", 0, i) + S.count("E", i + 1, len(S))
    ans = ans if ans <= _ans else _ans

print(ans)

Fixed submission:
N = int(input())
S = input()

l = 0
r = S.count("E", 1, len(S))
ans = l + r
for i in range(1, len(S)):
    if S[i] == "E":
        r -= 1
    if S[i - 1] == "W":
        l += 1

    ans = ans if ans <= l + r else l + r

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

ans = len(S) - 1
for i in range(len(S)):
    _ans = 0
    for j in range(i):
        if _ans >= ans:
            break

        s = S[j]
        if s == "W":
            _ans += 1

    if _ans >= ans:
        break

    for k in range(i + 1, len(S)):
        if _ans >= ans:
            break

        s = S[k]
        if s == "E":
            _ans += 1

    ans = ans if ans <= _ans else _ans

print(ans)

Fixed submission:
N = int(input())
S = input()

l = 0
r = S.count("E", 1, len(S))
ans = l + r
for i in range(1, len(S)):
    if S[i] == "E":
        r -= 1
    if S[i - 1] == "W":
        l += 1

    ans = ans if ans <= l + r else l + r

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = {}
for i in range(N):
    a[i + 1] = int(input())

for i in range(N):
    if a[i] == 2:
        print(i + 1)
        exit(0)
print(-1)

Fixed submission:
N = int(input())
a = {}
for i in range(N):
    a[i + 1] = int(input())

i = 1
cnt = 0
while True:
    next_i = a[i]
    cnt += 1
    if next_i < 1:
        print(-1)
        break
    elif next_i == 2:
        print(cnt)
        break

    a[i] = 0
    i = next_i

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = {}
for i in range(N):
    a[i + 1] = int(input())

i = 1
before_i = None
cnt = 0
while True:
    next_i = a[i]
    cnt += 1
    if next_i in [1, i, before_i]:
        print(-1)
        break
    elif next_i == 2:
        print(cnt)
        break

    before_i = i
    i = next_i

Fixed submission:
N = int(input())
a = {}
for i in range(N):
    a[i + 1] = int(input())

i = 1
cnt = 0
while True:
    next_i = a[i]
    cnt += 1
    if next_i < 1:
        print(-1)
        break
    elif next_i == 2:
        print(cnt)
        break

    a[i] = 0
    i = next_i

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = {}
for i in range(N):
    a[i + 1] = int(input())

i = 1
before_i = None
cnt = 0
while True:
    next_i = a[i]
    cnt += 1
    if next_i in [1, i, before_i]:
        print(-1)
        break
    elif next_i == 2:
        print(cnt)
        break

    i = next_i

Fixed submission:
N = int(input())
a = {}
for i in range(N):
    a[i + 1] = int(input())

i = 1
cnt = 0
while True:
    next_i = a[i]
    cnt += 1
    if next_i < 1:
        print(-1)
        break
    elif next_i == 2:
        print(cnt)
        break

    a[i] = 0
    i = next_i