Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
xn = input().split()
data = input().split()

data_2 = []

x = int(xn[0]) #これに近い値
data.sort() #小さい順

#dataにない値が出るまでxから１引き続ける　１引き続けた値をaとする

a = x-1
while True:
    #check
    for i in range(len(data)):
        if int(data[i]) == a:
            a = a - 1
            break
        else:
            data_2.append(a)
            break
    if a == int(data_2[0]):
        break

#dataにない値が出るまでxから１足し続ける　１足し続けた値をbとする
b = x + 1
while True:
    #check
    for i in range(len(data)):
        if int(data[i]) == b:
            b = b + 1
            break
        else:
            data_2.append(b)
            break
    if b == int(data_2[1]):
        break

#aとbの小さい方をprint
if a < b:
    print(a)
else:
    print(b)

Fixed submission:
list_sunuke = input().split()
list_m = []

for i in range(5):
    list_m.append(i+1)

for i in range(5):
    if int(list_sunuke[i]) != list_m[i]:
        print(list_m[i])

Buggy python submission (verdict: Runtime Error):
list_sunuke = []
list_m = []

for i in range(5):
    list_sunuke.append(input())

for i in range(5):
    list_m.append(i+1)

for i in range(5):
    if list_sunuke[i] != list_m[i]:
        print(list_m[i])
        break

Fixed submission:
list_sunuke = input().split()
list_m = []

for i in range(5):
    list_m.append(i+1)

for i in range(5):
    if int(list_sunuke[i]) != list_m[i]:
        print(list_m[i])

Buggy python submission (verdict: Runtime Error):
list_sunuke = []
list_m = []

for i in range(5):
    list_sunuke.append(input())

for i in range(5):
    list_m.append(i+1)

for i in range(5):
    if list_sunuke[i] != list_m[i]:
        print(list_m[0])
        break




Fixed submission:
list_sunuke = input().split()
list_m = []

for i in range(5):
    list_m.append(i+1)

for i in range(5):
    if int(list_sunuke[i]) != list_m[i]:
        print(list_m[i])
Buggy python submission (verdict: Runtime Error):
xn = input().split()
data_str = input().split()
data = [int(s) for s in data_str] #data_strをint型に変換

data_2 = []

x = int(xn[0]) #これに近い値
data.sort() #小さい順

print(data)

#dataにない値が出るまでxから１引き続ける　１引き続けた値をaとする
a = x-1
while True:
    #check
    for i in range(data):
        if data[i] == a:
            a = a - 1
        else:
            data_2.append(a)
            break
    if a == int(data_2[0]):
        break

#dataにない値が出るまでxかに１を足し続ける　１足し続けた値をbとする
b = x + 1
while True:
    #check
    for i in range(data):
        if int(data[i]) != b:
            data_2.append(b)
            print("bの値{}".format(b))
            break
        else:
            b = b + 1
            break
    if b == int(data_2[1]):
        break

#aとbの小さい方をprint
if abs(x-a) < abs(b-x):
    print(a)
else:
    print(b)

Fixed submission:
listt = input().split()

doubutsu = int(listt[0])
ashi = int(listt[1])

kame = (ashi-2*doubutsu)/2
tsuru = doubutsu - kame

if ashi%2 == 0 and kame >= 0 and tsuru >= 0:
    print('Yes')
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
listt = input().split()

#doubutsu = 2 #X
#ashi = 100 #Y
doubutsu = int(listt[0])
ashi = int(listt[1])

kame = (ashi-2*doubutsu)/2
tsuru = doubutsu - kame

if type(kame) == int and type(tsuru) == int:
    if kame >= 0 and tsuru >= 0:
        print("Yes")
    elif kame == 0 and tsuru == 0;
        print('No')
    else:
        print("No")
else:
    print("No")

Fixed submission:
listt = input().split()

doubutsu = int(listt[0])
ashi = int(listt[1])

kame = (ashi-2*doubutsu)/2
tsuru = doubutsu - kame

if ashi%2 == 0 and kame >= 0 and tsuru >= 0:
    print('Yes')
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
doubutsu, ashi = input().split()

#doubutsu = 2 #X
#ashi = 100 #Y

kame = (ashi-2*doubutsu)/2
tsuru = doubutsu - kame

if type(kame) == int and type(tsuru) == int:
    if kame >= 0 and tsuru >= 0:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Fixed submission:
listt = input().split()

doubutsu = int(listt[0])
ashi = int(listt[1])

kame = (ashi-2*doubutsu)/2
tsuru = doubutsu - kame

if ashi%2 == 0 and kame >= 0 and tsuru >= 0:
    print('Yes')
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
xn = input().split()
data = input().split()
data_2 = []

x = xn[0] #これに近い値
data.sort() #小さい順

#dataにない値が出るまでxから１引き続ける　１引き続けた値をaとする

a = x-1
while True:
    #check
    for i in range(len(data)):
        if data[i] == a:
            a = a - 1
            break
        else:
            data_2.append(a)
            break
    if a == data_2[0]:
        break

#dataにない値が出るまでxから１足し続ける　１足し続けた値をbとする
b = x + 1
while True:
    #check
    for i in range(len(data)):
        if data[i] == a:
            a = a + 1
            break
        else:
            data_2.append(a)
            break
    if b == data_2[1]:
        break

#aとbの小さい方をprint
if a < b:
    print(a)
else:
    print(b)

Fixed submission:
xn = input().split()
data_2 = []
x = int(xn[0]) #これに近い値

if int(xn[1]) == 0:
    print(x)
else:
    data_str = input().split()
    data = [int(s) for s in data_str] #data_strをint型に変換
    data.sort() #小さい順
    #dataにない値が出るまでxから１引き続ける　１引き続けた値をaとする
    a = int(xn[0])
    #check
    while True: #while1
        while True: #while2
            for i in range(len(data)):
                if data[i] != a:
                    continue
                else:
                    a -= 1
                    break #forから抜け出す
            else:
                data_2.append(a)
                break #while2から抜け出す

        if len(data_2) == 1: #リストに１つデータが入っていたら　入ってないならwhile1ループ
            break #while1から抜け出す    


    #dataにない値が出るまでxかに１を足し続ける　１足し続けた値をbとする
    b = int(xn[0])
    while True: #while1
        while True: #while2
            for i in range(len(data)):
                if data[i] != b:
                    continue
                else:
                    b += 1
                    break #forから抜け出す
            else:
                data_2.append(b)
                break #while2から抜け出す

        if len(data_2) == 2: #リストに2つデータが入っていたら　入ってないならwhile1ループ
            break #while1から抜け出す  


    #aとbの小さい方をprint
    if abs(x-a) <= abs(b-x):
        print(a)
    else:
        print(b)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int, input().split()))

ans = 1
for a in A:
    ans *= a
    if ans == 0:
        print(0)
        exit()
if ans > 10**18:
    print(-1)
else:
    print(ans)

Fixed submission:
n=int(input())
A=list(map(int, input().split()))

ans = 1
if 0 in A:
    print(0)
    exit()
for a in A:
    ans *= a
    if ans > 10**18:
        print(-1)
        exit()
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int, input().split()))

ans = 1
for a in A:
    ans *= a

if ans > 10**18:
    print(-1)
else:
    print(ans)

Fixed submission:
n=int(input())
A=list(map(int, input().split()))

ans = 1
if 0 in A:
    print(0)
    exit()
for a in A:
    ans *= a
    if ans > 10**18:
        print(-1)
        exit()
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(str, input().split()))

from collections import Counter

c = Counter(A)
ind = list(c)
for i in range(1,N+1):
    if str(i) in ind:
        print(c[str(i)])
    else:
        print(0)



Fixed submission:
N=int(input())
A=list(map(int, input().split()))

x = [0]*N

for a in A:
    x[a-1] += 1

for i in x:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(str, input().split()))
 
from collections import Counter
 
c = Counter(A)
 
for i in range(1,N+1):
    if str(i) in list(c):
        print(c[str(i)])
    else:
        print(0)

Fixed submission:
N=int(input())
A=list(map(int, input().split()))

x = [0]*N

for a in A:
    x[a-1] += 1

for i in x:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(str, input().split()))

from collections import Counter

c = Counter(A)

for i in range(1,N+1):
    if str(i) in list(c):
        print(c[str(i)])
    else:
        print(0)



Fixed submission:
N=int(input())
A=list(map(int, input().split()))

x = [0]*N

for a in A:
    x[a-1] += 1

for i in x:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
K=int(input())

import fractions,itertools
data = [i for i in range(1,K+1)]

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
ans = 0
for a,b,c in itertools.product(data, repeat=3):
    ans += gcd(a,b,c)
print(ans)



Fixed submission:
K=int(input())

import itertools,math
from functools import reduce

data = [i for i in range(1,K+1)]

def gcd(*numbers):
    return reduce(math.gcd, numbers)

ans = 0
for a,b,c in itertools.product(data, repeat=3):
    ans += gcd(a,b,c)
print(ans)

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

import fractions,itertools
data = [i for i in range(1,K+1)]


ans = 0
for trip in itertools.product(data, repeat=3):
    ans_ = trip[0]
    for i in range(1, 3):
        ans_ = fractions.gcd(ans_, trip[i])
    ans += ans_
print(ans)



Fixed submission:
K=int(input())

import itertools,math
from functools import reduce

data = [i for i in range(1,K+1)]

def gcd(*numbers):
    return reduce(math.gcd, numbers)

ans = 0
for a,b,c in itertools.product(data, repeat=3):
    ans += gcd(a,b,c)
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N=int(input())
S = input()

c=S.count
r,g,b=c('R'),c('G'),c('B')

ans = r*g*b

for i in range(N):
  for d in range(N):
    j = i+d
    k = j*d
    if k >= n:
      break
    if S[i] != S[j] and S[j] != S[k] and S[i] != S[i]:
      ans -= 1
    
print(ans)


Fixed submission:
n = int(input())
s = input()
 
r_cnt = s.count('R')
g_cnt = s.count('G')
b_cnt = s.count('B')
 
ans = r_cnt * g_cnt * b_cnt
 
for i in range(n):
    for d in range(n):
        j = i + d
        k = j + d
        if k >= n:
            break
        if s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
            ans -= 1
print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N=int(input())
S = input()

c=S.count
r,g,b=c('R'),c('G'),c('B')

ans = r*g*b

for i in range(n):
  for d in range(n):
    j = i+d
    k = j*d
    if k >= n:
      break
    if s[i] != s[j] and s[j] != s[k] and s[i] != s[i]:
      ans -= 1
    
print(ans)


Fixed submission:
n = int(input())
s = input()
 
r_cnt = s.count('R')
g_cnt = s.count('G')
b_cnt = s.count('B')
 
ans = r_cnt * g_cnt * b_cnt
 
for i in range(n):
    for d in range(n):
        j = i + d
        k = j + d
        if k >= n:
            break
        if s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
            ans -= 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,a,b=map(int, input().split())
cnt = 0
tmp = n
mode = 0
if a == 0:
    cnt = 0
elif a+b == n:
    cnt = a
else:
    while True:
        if tmp >= a and mode == 0:
            tmp = tmp - a
            cnt += a
            mode = 1
        elif mode == 1:
            tmp = tmp-b
            mode = 0
        elif tmp < a and mode == 0:
            cnt += tmp
            tmp = tmp -a
        if tmp <= 0:
            break
        
print(cnt)
    
    


Fixed submission:
import math
n,a,b=map(int, input().split())
cnt = 0
mode = 0
if a == 0:
    cnt = 0
elif a+b == n:
    cnt = a
else:
    roop = math.floor(n / (a+b))
    anc_a = a*roop
    n_b = n-(roop*(a+b))
    while True:
        if n_b >= a and mode == 0:
            n_b = n_b - a
            cnt += a
            mode = 1
        elif mode == 1:
            n_b = n_b-b
            mode = 0
        elif n_b < a and mode == 0:
            cnt += n_b
            n_b = n_b -a
        if n_b <= 0:
            break
    cnt += anc_a 
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n,a,b=map(int, input().split())
mode = 0
cnt = 0
tmp = 0
for i in range(1,n+1):
    if a == 0: break
    if a+b == n: 
        cnt += a
        break
    if mode == 0 and tmp <= a:
        cnt += 1
        tmp += 1
    elif tmp == a and mode == 0:
        tmp = 0
        mode = 1

    if mode == 1 and tmp <= b:
        tmp += 1
    elif tmp == b and mode == 1:
        tmp = 0
        mode = 0
print(cnt)
    
    


Fixed submission:
import math
n,a,b=map(int, input().split())
cnt = 0
mode = 0
if a == 0:
    cnt = 0
elif a+b == n:
    cnt = a
else:
    roop = math.floor(n / (a+b))
    anc_a = a*roop
    n_b = n-(roop*(a+b))
    while True:
        if n_b >= a and mode == 0:
            n_b = n_b - a
            cnt += a
            mode = 1
        elif mode == 1:
            n_b = n_b-b
            mode = 0
        elif n_b < a and mode == 0:
            cnt += n_b
            n_b = n_b -a
        if n_b <= 0:
            break
    cnt += anc_a 
print(cnt)
Buggy python submission (verdict: Runtime Error):
N,M=map(int, input().split())

sc = []
for i in range(m):
    sc.append(list(map(int, input().split())))
for i in range(10**N):
    ans = str(i)
    if len(ans) == N and all(ans[s-1] == str(c) for s,c in sc):
        print(ans)
        quit()
print(-1)

Fixed submission:
N,M=map(int, input().split())

sc = []
for i in range(M):
    sc.append(list(map(int, input().split())))
for i in range(10**N):
    ans = str(i)
    if len(ans) == N and all(ans[s-1] == str(c) for s,c in sc):
        print(ans)
        quit()
print(-1)

Buggy python submission (verdict: Runtime Error):
N,M=map(int, input().split())

sc = []
for i in range(m):
    sc.append(list(map(int, input().split())))
for i in range(10**N):
    anc = str(i)
    if len(ans) == N and all(ans[s-1] == str(c) for s,c in sc):
        print(ans)
        quit()
print(-1)

Fixed submission:
N,M=map(int, input().split())

sc = []
for i in range(M):
    sc.append(list(map(int, input().split())))
for i in range(10**N):
    ans = str(i)
    if len(ans) == N and all(ans[s-1] == str(c) for s,c in sc):
        print(ans)
        quit()
print(-1)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int, input().split()))

even = [i for i in a if a % 2 == 0]

cnt = 0
for e in even:
    if e % 3 == 0 or e % 5 == 0:
        cnt += 1
if cnt == len(even):
    print('APPROVED')
else:
    print('DENIED')

Fixed submission:
n=int(input())
a=list(map(int, input().split()))
anc = 'APPROVED'
for i in a:
    if i % 2 == 0 and i % 3 != 0 and i % 5 != 0:
        anc = 'DENIED'
print(anc)
Buggy python submission (verdict: Runtime Error):
N,K=map(int, input().split())
H=list(map(int, input().split()))

H_sort = sorted(H, reverse=True)

if N <= K:
    print(0)
    quit()
for i in range(K):
    del H_sort[i]

print(sum(H_sort))

Fixed submission:
n, k = map(int, input().split())
h = sorted(map(int, input().split()))
 
x = 0

if n - k <= 0:
    print(0)
else:
    for i in range(n-k):
        x += h[i]
    print(x)

Buggy python submission (verdict: Runtime Error):
N,K=map(int, input().split())
H=list(map(int, input().split()))

H_sort = sorted(H, reverse=True)

for i in range(K):
    del H_sort[i]

print(sum(H_sort))
    

Fixed submission:
n, k = map(int, input().split())
h = sorted(map(int, input().split()))
 
x = 0

if n - k <= 0:
    print(0)
else:
    for i in range(n-k):
        x += h[i]
    print(x)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n=int(input())
p=np.array(list(map(int, input().split())))

cnt = 0
for i,v in enumerate(p):
    if i == 0:
        cnt += 1
        continue
    if np.min(p[:i]) > v:
        cnt += 1
print(cnt)

Fixed submission:
n=int(input())
p=list(map(int, input().split()))

cnt = 0
for i,v in enumerate(p):
    if i == 0:
        cnt += 1
        min_ = v
        continue
    if min_ > v:
        min_ = v
        cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
p=list(map(int, input().split()))

cnt = 0
for i,v in enumerate(p):
    if i == 0:
        cnt += 1
        continue
    if min(p[:i]) > v:
        cnt += 1
print(cnt)

Fixed submission:
n=int(input())
p=list(map(int, input().split()))

cnt = 0
for i,v in enumerate(p):
    if i == 0:
        cnt += 1
        min_ = v
        continue
    if min_ > v:
        min_ = v
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
import math
a,b=map(int, input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))

Fixed submission:
import fractions
a,b=map(int, input().split())
def lcm(x, y):
  return (x * y) // fractions.gcd(x, y)
 
print(lcm(a, b))
Buggy python submission (verdict: Runtime Error):
N,K =map(int, input().split())
A=list(map(int, input().split()))
cnt = 0
for i in A :
    if i >= k:
        cnt +=1
print(cnt)

Fixed submission:
N,K =map(int, input().split())
A=list(map(int, input().split()))
cnt = 0
for i in A :
    if i >= K:
        cnt +=1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int, input().split()))

for i in range(1,n+1):
    print(A.index(i)+1,end = " ")

Fixed submission:
n=int(input())
A=list(map(int, input().split()))
order = {}

for i in range(n):
    order[A[i]] = i+1

for i in range(1,n+1):
    print(order[i],end=" ")
Buggy python submission (verdict: Time Limit Exceeded):
n,k,q=map(int, input().split())

A = []
for i in range(q):
    A.append(int(input()))

score = [k]*n

for i in A:
    score = list(map(lambda x:x-1,score) )
    score[i-1]+=1

for i in score:
    if i <= 0:
        print('No') 
    else:
        print('Yes')

Fixed submission:
n,k,q=map(int, input().split())

A = []
for i in range(q):
    A.append(int(input()))

score = [k]*n
score = list(map(lambda x:x-q,score) )
for i in A:
     
    score[i-1]+=1

for i in score:
    if i <= 0:
        print('No') 
    else:
        print('Yes')
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int, input().split()))
b=list(map(int, input().split()))
c=list(map(int, input().split()))
cnt=0
for i,v in enumerate(a):
	cnt += b[v-1]
	if i == 0:continue
	if v-1 == a[i-1]:
		#print(c[v-1])
		cnt += c[v-2]
print(cnt)

Fixed submission:
n=int(input())

print(n**3)
Buggy python submission (verdict: Runtime Error):
m,d = map(int,input().split())
d1,d2 = str(d)[0],str(d)[1]
cnt = 0
m_list = [i+1 for i in range(m)]
for i in range(d):
  if i >= 20:
    d1,d2 = str(i)[0],str(i)[1]
    if d1=='1' or d2=='1':
      continue
    if int(d1)*int(d2) in m_list:
      
      cnt += 1
print(cnt)
    

Fixed submission:
m,d = map(int,input().split())
if len(str(d)) == 2:
	d1,d2 = str(d)[0],str(d)[1]

cnt = 0
m_list = [i+1 for i in range(m)]

if len(str(d)) == 2:
  for i in range(d+1):
    
    if i >= 20:
      d1,d2 = str(i)[0],str(i)[1]
      if d1=='1' or d2=='1':
        continue
      if int(d1)*int(d2) in m_list:
        cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter


n=int(input())
S = []
for i in range(n):
    S.append(input())

cnt = 0
for i,s in enumerate(S):
    for j,s2 in enumerate(S):
        if i >= j: continue
        if Counter(s) == Counter(s2):
            cnt += 1

print(cnt)

Fixed submission:
from collections import Counter


n=int(input())
S = []
for i in range(n):
    S.append(''.join(sorted(input())))

cnt = Counter(S)
 
ans = 0
for num in cnt.values():
    ans += num*(num-1)//2
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
n, d = map(int, input().split())
p = 0
for i in range(n):
  x, y = map(int, input().split())
  if sqrt(pow(abs(x),2)+pow(abs(y),2)) <= d :
    p += 1
print(p)

Fixed submission:
from math import *
n, d = map(int, input().split())
p = 0
for i in range(n):
  x, y = map(int, input().split())
  if sqrt(pow(abs(x),2)+pow(abs(y),2)) <= d :
    p += 1
print(p)

Buggy python submission (verdict: Runtime Error):
import math
n, d = map(int, input().split())
p = 0
for i in range(n):
  x, y = map(int, input().split())
  if sqrt(pow(x,2)+pow(y,2)) ≤ d :
    p += 1
print(p)
  

Fixed submission:
from math import *
n, d = map(int, input().split())
p = 0
for i in range(n):
  x, y = map(int, input().split())
  if sqrt(pow(abs(x),2)+pow(abs(y),2)) <= d :
    p += 1
print(p)
Buggy python submission (verdict: Runtime Error):
    x, y = map(int, input().split())
    for i in range(x+1):
      if((i*2 + (x-i)*4) == y):
        print("Yes")
    	break
      else:
    	print("No")
    	break

Fixed submission:
x, y = map(int, input().split())
res = 'No'
for i in range(x+1):
  k = x-i
  if(i*2 + k*4) == y:
    res = 'Yes'
print(res)

Buggy python submission (verdict: Runtime Error):
x, y = map(int, input().split())
for i in range(x+1):
  if((i*2 + (x-i)*4) == y) or ((i*4 +(x-i)*2) == y):
    print("Yes")
	break
  else:
	print("No")
	break

Fixed submission:
x, y = map(int, input().split())
res = 'No'
for i in range(x+1):
  k = x-i
  if(i*2 + k*4) == y:
    res = 'Yes'
print(res)

Buggy python submission (verdict: Runtime Error):
x, y = map(int, input().split())
for i in range(x+1):
  if(i*2 + (x+1-i)*4) == y or (i*4 + (x+1-i)*2) == y:
	print("Yes")
  else:
    print("No")
  break

Fixed submission:
x, y = map(int, input().split())
res = 'No'
for i in range(x+1):
  k = x-i
  if(i*2 + k*4) == y:
    res = 'Yes'
print(res)
Buggy python submission (verdict: Runtime Error):
    from functools import reduce
    n = int(input())
    tab = [int(n) for n in input().split()]
    if 0 in tab:
      print("0")
    res = reduce(lambda x, y: x*y, tab)
    if res > 1000000000000000000:
      print("-1")
    else:
      print(res)

Fixed submission:
def main():
	N = int(input())
	A = list(map(int, input().split()))
	if 0 in A:
		print(0)
		return
	prod = 1
	for a in A:
		prod *= a
		if prod > 1000000000000000000:
			print(-1)
			return
	print(prod)
main()

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
n = int(input())
tab = [int(i) for i in input().split()]

if reduce(lambda x, y: x*y, tab) > pow(10, 18):
  print("-1")
else:
  print(reduce(lambda x, y: x*y, tab))

Fixed submission:
def main():
	N = int(input())
	A = list(map(int, input().split()))
	if 0 in A:
		print(0)
		return
	prod = 1
	for a in A:
		prod *= a
		if prod > 1000000000000000000:
			print(-1)
			return
	print(prod)
main()

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
n = int(input())
tab = [int(n) for n in input().split()]
res = reduce(lambda x, y: x*y, tab)
if res > pow(10, 18):
  print("-1")
else:
  print(res)

Fixed submission:
def main():
	N = int(input())
	A = list(map(int, input().split()))
	if 0 in A:
		print(0)
		return
	prod = 1
	for a in A:
		prod *= a
		if prod > 1000000000000000000:
			print(-1)
			return
	print(prod)
main()

Buggy python submission (verdict: Time Limit Exceeded):
import math
n = int(input())
res = 1
tab = [int(n) for n in input().split()]
for i in tab:
    res = res * i
if res > pow(10, 18):
  print("-1")
else:
  print(res)

Fixed submission:
def main():
	N = int(input())
	A = list(map(int, input().split()))
	if 0 in A:
		print(0)
		return
	prod = 1
	for a in A:
		prod *= a
		if prod > 1000000000000000000:
			print(-1)
			return
	print(prod)
main()
Buggy python submission (verdict: Runtime Error):
import math
N, D = map(int, input().split())
l = [list(map(int, input().split())) for l in range(N)]
 
ans=0
for i,a in enumerate(l):
    if math.sqrt(a[0]**2 + a[1]**2)<=D:
        ans+=1
ans

Fixed submission:
s = int(input()) 

print("Yes" if s>=30 else "No")
Buggy python submission (verdict: Runtime Error):
import math
print math
N, D = map(int, input().split())
l = [list(map(int, input().split())) for l in range(N)]

ans=0
x=3
for i,a in enumerate(l):
    if math.sqrt(a[0]**2 + a[1]**2)>D :
        ans+=1

Fixed submission:
import math
N, D = map(int, input().split())
l = [list(map(int, input().split())) for l in range(N)]
 
ans=0
for i,a in enumerate(l):
    if math.sqrt(a[0]**2 + a[1]**2)<=D:
        ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input().split()
a = input().split()
if s+a[-1]==a:
  print("yes")
else:
  print("no")

Fixed submission:
s = input()
t = input()
if s +t[-1]==t:
  print('Yes')
else:
  print('No')