Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
Aj = list(map(int, input()split()))

ans = 1
ng = false
max = 10**18
for A in Aj:
	if A == 0:
		ans = 0
		break
	if ans*A > max:
		ans *= A
print(ans)

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

ans = 1
ng = False
max = 10**18
for A in Aj:
	if A == 0:
		ans = 0
		break
	if ng or ans*A > max:
		ans = -1
		ng = True
	else:
		ans *= A
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
Aj = [int(i) for i in input().split()]

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


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

ans = 1
ng = False
max = 10**18
for A in Aj:
	if A == 0:
		ans = 0
		break
	if ng or ans*A > max:
		ans = -1
		ng = True
	else:
		ans *= A
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce
N = int(input())
Aj = list(map(int, input().split()))

ans = reduce(mul, Aj)

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


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

ans = 1
ng = False
max = 10**18
for A in Aj:
	if A == 0:
		ans = 0
		break
	if ng or ans*A > max:
		ans = -1
		ng = True
	else:
		ans *= A
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
Aj = list(map(int, input().split()))
Aj_coll = collections.Counter(Aj)
ans = 1
for k, v in Aj_coll.items():
	ans *= k**v
if ans > 10**18:
	ans = -1
print(ans)


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

ans = 1
ng = False
max = 10**18
for A in Aj:
	if A == 0:
		ans = 0
		break
	if ng or ans*A > max:
		ans = -1
		ng = True
	else:
		ans *= A
print(ans)

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

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

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


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

ans = 1
ng = False
max = 10**18
for A in Aj:
	if A == 0:
		ans = 0
		break
	if ng or ans*A > max:
		ans = -1
		ng = True
	else:
		ans *= A
print(ans)
Buggy python submission (verdict: Runtime Error):
from decimal import Decimal

A, B = map(float, input().split())
ans = int(A*Decimal(str(B)))
print(ans)

Fixed submission:
from decimal import Decimal

A, B = map(float, input().split())
ans = int(Decimal(str(A))*Decimal(str(B)))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)
    
K = int(input())

sum = 0
for a in range(K):
	for b in range(K):
		for c in range(K):
			sum += gcd(a+1, b+1, c+1)
print(sum)

Fixed submission:
import math
    
K = int(input())

sum = 0
dict = {}
for a in range(K):
	for b in range(K):
		ab = math.gcd(a+1, b+1)
		if ab in dict:
			dict[ab] = dict[ab]+1 
		else:
			dict[ab] = 1
for c in range(K):
	for ab in dict:
		sum += math.gcd(ab, c+1)*dict[ab]
print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = list(input())

sum = 0
for i in range(N):
	for j in range(N-i):
		if S[j+i] != S[i]:
			for k in range(N-(j+i)):
				if S[k+j+i] != S[i] and S[k+j+i] != S[j+i] and (j+i)-i != (k+j+i)-(j+i):
					sum += 1
print(sum)


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

R = 0
G = 0
B = 0

for i in range(N):
	if S[i] == 'R':
		R += 1
	elif S[i] == 'G':
		G += 1
	else:
		B += 1
ans = R*G*B
for i in range(N-2):
	for j in range(i+1, N-1):
		k = j+(j-i)
		if k >= N:
			break
		if S[i]!=S[j] and S[i]!=S[k] and S[j]!=S[k]:
			ans -= 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys

def main():
    args = [int(input()) for i in range(2)]
    list = [1, 2, 3]
    for i in list:
        flg = False
        for j in args:
            if j == i:
                flg = True
        if not flg:
            print(i)
            return i

if __name__ == "__main__":
    sys.exit(main())

Fixed submission:
args = [int(input()) for i in range(2)]
list = [1, 2, 3]
for i in list:
    flg = False
    for j in args:
        if j == i:
            flg = True
    if not flg:
        print(i)

Buggy python submission (verdict: Runtime Error):
import sys

def main():
    args = [int(input()) for i in range(2)]
    list = [1, 2, 3]
    for i in list:
        flg = False
        for j in args:
            if j == i:
                flg = True
        if not flg:
            print(i)
            return i

if __name__ == "__main__":
    sys.exit(main())

Fixed submission:
args = [int(input()) for i in range(2)]
list = [1, 2, 3]
for i in list:
    flg = False
    for j in args:
        if j == i:
            flg = True
    if not flg:
        print(i)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = [str(i) for _ in range(n)]
for i in ("AC","WA","TLE","RE"):
	print("{0} x {1}".format(i,s.count(i))

Fixed submission:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

n = i()
s = [s() for _ in range(n)]

ac = 0
wa = 0
tle = 0
re = 0
for i in range(n):
	if s[i] == "AC":
		ac += 1
	elif s[i] == "WA":
		wa += 1
	elif s[i] == "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):
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

x,n = i2()
p = intl()

m = 100
ls = [int(i) for i in range(1,101)]
for i in range(n):
	ls.remove(p[i])
for j in range(len(ls)):
	if abs(x - ls[j]) < m :
		m = abs(x - ls[j])
		ans = ls[j]
		
print(ans) 

Fixed submission:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

x,n = i2()
p = intl()

m = 100
ls = [int(i) for i in range(-200,200)]
for i in range(n):
	ls.remove(p[i])
for j in range(len(ls)):
	if abs(x - ls[j]) < m :
		m = abs(x - ls[j])
		ans = ls[j]
print(ans)
Buggy python submission (verdict: Runtime Error):
# include <bits/stdc++.h>
using namespace std;

int main(){
	int a,b;
	cin >> a >> b;
	cout << a*b << endl;
}

Fixed submission:
a,b = map(int,input().split())
print(a*b)
Buggy python submission (verdict: Runtime Error):
a,b,h,m = map(int,input().split())
import math
mi = 360*(((60*h + m) % 60) / 60)
hour = 360*(((60*h + m) % 720) / 720)
cos = 0
ans = 0
if hour > mi:
	cos = math.cos(math.radians(hour - mi))
	ans = (a**2 + b**2 - 2*a*b*cos)**0.5
elif hour == mi:
	ans = 0
elif hour +180 > mi:
	cos = math.cos(math.radians(mi - hour))
	ans = (a**2 + b**2 - 2*a*b*cos)**0.5
elif hour + 180 == mi:
	ans = a + b
elif hour + 180 < mi:
	cos.hour = math.cos(math.radians(hour - mi + 360))
	ans = (a**2 + b**2 - 2*a*b*cos)**0.5
print(cos)
print(ans)


Fixed submission:
import math
a,b,h,m = map(int,input().split())

ans = 0
cos = 0
mi = m/60 * 360 #分針の角度
hour = (60*h + m)/720 * 360 #時針の角度

cos = math.cos(math.radians(hour - mi))
ans = a*a + b*b -2*a*b*cos
#余弦定理
ans = ans ** (1/2)
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b,h,m = map(int,input().split())
import math
mi = 360*(((60*h + m) % 60) / 60)
hour = 360*(((60*h + m) % 720) / 720)
print(hour)
print(mi)
cos = 0
ans = 0
if hour > mi:
	cos = math.cos(math.radians(hour - mi))
	ans = (a**2 + b**2 - 2*a*b*cos)**0.5
elif hour == mi:
	ans = 0
elif hour +180 > mi:
	cos = math.cos(math.radians(mi - hour))
	ans = (a**2 + b**2 - 2*a*b*cos)**0.5
elif hour + 180 == mi:
	ans = a + b
elif hour + 180 < mi:
	cos.hour = math.cos(math.radians(hour - mi + 360))
	ans = (a**2 + b**2 - 2*a*b*cos)**0.5
print(cos)
print(ans)

Fixed submission:
import math
a,b,h,m = map(int,input().split())

ans = 0
cos = 0
mi = m/60 * 360 #分針の角度
hour = (60*h + m)/720 * 360 #時針の角度

cos = math.cos(math.radians(hour - mi))
ans = a*a + b*b -2*a*b*cos
#余弦定理
ans = ans ** (1/2)
print(ans)
Buggy python submission (verdict: Runtime Error):
def i():
    return int(input())
def i2():
    return map(int,input().split())
def s():
    return str(input())
def l():
    return list(input())
def intl():
    return list(int(k) for k in input().split())

n,m=i2()
h=intl()
cnt=0
score=0
l=[[] for i in range(n)]
for j in range(m):
	a,b=i2()
	l[a-1].append(b-1)
	l[b-1].append(a-1)
for j in range(n):
	for k in l[j]:
		if h[j]>h[k]:
			cnt+=1
			if cnt==len(l[j]):
				score+=1
	cnt=0
for i in range(m):
	if len(l[i])==0:
		score+=1
print(score)

Fixed submission:
def i():
    return int(input())
def i2():
    return map(int,input().split())
def s():
    return str(input())
def l():
    return list(input())
def intl():
    return list(int(k) for k in input().split())

n,m=i2()
h=intl()
cnt=0
score=0
l=[[] for i in range(n)]
for j in range(m):
	a,b=i2()
	l[a-1].append(b-1)
	l[b-1].append(a-1)
for j in range(n):
	for k in l[j]:
		if h[j]>h[k]:
			cnt+=1
			if cnt==len(l[j]):
				score+=1
	cnt=0
for i in range(n):
	if len(l[i])==0:
		score+=1
print(score)

Buggy python submission (verdict: Runtime Error):
def i():
    return int(input())
def i2():
    return map(int,input().split())
def s():
    return str(input())
def l():
    return list(input())
def intl():
    return list(int(k) for k in input().split())

n,m=i2()
h=intl()
cnt=0
score=0
l=[[] for i in range(n)]
for j in range(m):
	a,b=i2()
	l[a-1].append(b-1)
	l[b-1].append(a-1)
for j in range(n):
	for k in l[j]:
		if h[j]>k:
			cnt+=1
			if cnt==len(l[j]):
				score+=1
	cnt=0
for i in range(m):
	if len(l[i])==0:
		score+=1
print(score)


Fixed submission:
def i():
    return int(input())
def i2():
    return map(int,input().split())
def s():
    return str(input())
def l():
    return list(input())
def intl():
    return list(int(k) for k in input().split())

n,m=i2()
h=intl()
cnt=0
score=0
l=[[] for i in range(n)]
for j in range(m):
	a,b=i2()
	l[a-1].append(b-1)
	l[b-1].append(a-1)
for j in range(n):
	for k in l[j]:
		if h[j]>h[k]:
			cnt+=1
			if cnt==len(l[j]):
				score+=1
	cnt=0
for i in range(n):
	if len(l[i])==0:
		score+=1
print(score)
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
a=0
if h=1 or w=1:
	a=1
else:
	if h%2==1 and w%2==1:
		a=(h*w+1)/2
	else:
		a=h*w/2
print(a)


Fixed submission:
h,w=map(int,input().split())
a=0
if h==1 or w==1:
	a=1
else:
	if h%2==1 and w%2==1:
		a=(h*w+1)//2
	else:
		a=h*w//2
print(a)

Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
a=0
if h=1 or w=1:
	a=1
elif:
	if h%2==1 and w%2==1:
		a=(h*w+1)/2
	else:
		a=h*w/2
print(a)


Fixed submission:
h,w=map(int,input().split())
a=0
if h==1 or w==1:
	a=1
else:
	if h%2==1 and w%2==1:
		a=(h*w+1)//2
	else:
		a=h*w//2
print(a)

Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
a=0
if h=a or w=1:
	a=1
elif:
	if h%2==1 and w%2==1:
		a=(h*w+1)/2
	else:
		a=h*w/2
print(a)


Fixed submission:
h,w=map(int,input().split())
a=0
if h==1 or w==1:
	a=1
else:
	if h%2==1 and w%2==1:
		a=(h*w+1)//2
	else:
		a=h*w//2
print(a)
Buggy python submission (verdict: Runtime Error):
import math
a,b,c=map(int,input().split())
r=math.sqrt(a)*math.sqrt(b)
if a+b+2r-c<0:
	print('Yes')
else:
	print('No')


Fixed submission:
a,b,c=map(int,input().split())
if 4*a*b<(c-a-b)**2 and c-a-b>0:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
s=input().split()
a=0
for i in range(3):
	if s[i]==A:
		a+=1
if a==0 or a==3:
	print('No')
else:
	print('Yes')

Fixed submission:
s=list(input())
a=0
for i in range(3):
	if s[i]=='A':
		a+=1
if a==0 or a==3:
	print('No')
else:
	print('Yes')
Buggy python submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
c=0
d=0
if a==0:
	print(0)
else:
	if n>=(a+b):
		c=n//(a+b)
		d=a*c+n-c*(a+b)
		print(d)
	else:
		if n>=a:
			c=n//a
			ptint(a*c)
		else:
			print(n)

Fixed submission:
n,a,b=map(int,input().split())
c=n//(a+b)
d=0
if a==0:
	print(0)
else:
	if n>=(a+b):
		if n-c*(a+b)<=a:
			d=a*c+n-c*(a+b)
			print(d)
		else:
			d=a*(c+1)
			print(d)
	else:
		if n>=a:
			print(a)
		else:
			print(n)

Buggy python submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
c=0
d=0
if a==0:
	print(0)
else:
	if n>=(a+b):
		c=n//(a+b)
		d=a*c+n-c*(a+b)
		print(d)
	else:
		if n>=a:
			c=n//a
			ptint(a*c)
		else:
			print(a)

Fixed submission:
n,a,b=map(int,input().split())
c=n//(a+b)
d=0
if a==0:
	print(0)
else:
	if n>=(a+b):
		if n-c*(a+b)<=a:
			d=a*c+n-c*(a+b)
			print(d)
		else:
			d=a*(c+1)
			print(d)
	else:
		if n>=a:
			print(a)
		else:
			print(n)
Buggy python submission (verdict: Runtime Error):
2 2

Fixed submission:
import math
a,b=map(int,input().split())
for i in range(1,1009):
	A=math.floor(i*0.08)
	B=math.floor(i*0.1)
	if a==A and b==B:
		print(i)
		exit()
print(-1)
Buggy python submission (verdict: Runtime Error):
n=int(input())
x=[int(i) for i in input().split()]
a=[]
p=0
for i in range(1,max(x)):
  for j in range(n):
    p+=(x[j]-i)**2
  a.append(p)
  p=0
print(min(a))

Fixed submission:
n=int(input())
x=[int(i) for i in input().split()]
a=[]
p=0
for i in range(1,max(x)+1):
  for j in range(n):
    p+=(x[j]-i)**2
  a.append(p)
  p=0
print(min(a))

Buggy python submission (verdict: Runtime Error):
n=int(input())
x=[int(i) for i in input().split()]
a=[]
p=0
for i in range(1,n**n):
  for j in range(n):
    p+=(x[j]-i)**2
  a.append(p)
  p=0
print(min(a))

Fixed submission:
n=int(input())
x=[int(i) for i in input().split()]
a=[]
p=0
for i in range(1,max(x)+1):
  for j in range(n):
    p+=(x[j]-i)**2
  a.append(p)
  p=0
print(min(a))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[str() for i in range(n)]
b=[]
for j in range(n):
  for k in range(n):
    if a[j]==a[k]:
      b=a[j]
b.sort()
print(b)

Fixed submission:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

n = i()
#s = {s():0 for _ in range(n)}

a = {}
for i in range(n):
	s = input()
	try:
		a[s] += 1
	except KeyError:
		a[s] = 1
b = sorted(a.items(),key = lambda x:x[0])

memo = max([i[1] for i in a.items()])
for i in b:
	"""print(i,"i")
	print(i[0],"i[0]")
	print(i[1],"i[1]")
	print(max(b)[0],"max(b)[0]")"""
	if i[1] == memo:
		print(i[0])
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(i) for i in input().split()]
b=0
for j in range(n):
  for k in range(n):
    if a[j]==a[k] and j!=k:
      b+=1
if b==0:
  print('YES')
else:
  print('NO')

Fixed submission:
n=int(input())
a=[int(i) for i in input().split()]
a.sort()
for j in range(n-1):
	if a[j]<a[j+1]:
		pass
	else:
		print('NO')
		exit()
print('YES')

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[int() for i in input().split()]
b=0
for j in range(n):
  for k in range(n):
    if a[j]==a[k] and j!=k:
      b+=1
　　break
if b==0:
  print('YES')
else:
  print('NO')

Fixed submission:
n=int(input())
a=[int(i) for i in input().split()]
a.sort()
for j in range(n-1):
	if a[j]<a[j+1]:
		pass
	else:
		print('NO')
		exit()
print('YES')
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
h=[int(i) for i in input().split()]
h.sort
a=0
if n-k<=0:
  print(0)
else:
  for j in range(n-k):
    while True:
      if h[j]-1>0:
        h[j]=h[j]-1
        a+=1
      else:
        break
  print(a+k+1)

Fixed submission:
n,k=map(int,input().split())
h=[int(i) for i in input().split()]
h.sort()
a=0
if n>k:
  for j in range(n-k):
    a+=h[j]
  print(a)
else:
  print(0)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = [int(i) for i in input().split()]

m = max(p)
cnt = 1
for i in range(1,n):
	if m > min(p[0:i]):
		m = min(p[0:i])
	if m >= p[i]:
		cnt += 1
print(cnt)

Fixed submission:
n = int(input())
p = [int(i) for i in input().split()]

cnt = 1
m = p[0]
for i in range(1,n):
	if m > p[i-1]:
		m = p[i-1]
	if m >= p[i]:
		cnt += 1
	#print(cnt,i)
	#print(p[0:i],p[i])
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = [int(i) for i in input().split()]

cnt = 1
for i in range(1,n):
	if min(p[0:i]) >= p[i]:
		cnt += 1
	#print(cnt,i)
	#print(p[0:i],p[i])
print(cnt)

Fixed submission:
n = int(input())
p = [int(i) for i in input().split()]

cnt = 1
m = p[0]
for i in range(1,n):
	if m > p[i-1]:
		m = p[i-1]
	if m >= p[i]:
		cnt += 1
	#print(cnt,i)
	#print(p[0:i],p[i])
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = [int(i) for i in input().split()]

cnt = 0
for i in range(n):
	for j in range(i+1):
		if p[j] < p[i]:
			cnt += 1
			break

print(n - cnt)

Fixed submission:
n = int(input())
p = [int(i) for i in input().split()]

cnt = 1
m = p[0]
for i in range(1,n):
	if m > p[i-1]:
		m = p[i-1]
	if m >= p[i]:
		cnt += 1
	#print(cnt,i)
	#print(p[0:i],p[i])
print(cnt)
Buggy python submission (verdict: Runtime Error):
a=input()
b=a.next(a)
print(b)


Fixed submission:
alp='abcdefghijklmnopqrstuvwxyz'
s=str(input())
flag=False
for c in alp:
  if flag:
    print(c)
    break
  if c==s:
    flag=True
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=input()

count=0
for i in range(a-2):
  if b[i]=='A'and b[i+1]=='B' and b[i+2]=='C':
    count+=1
print(count)


Fixed submission:
a,b=map(int,input().split())
if 500*a>=b:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=input()

count=0
for i in range(a-2):
  if b[i]='a'and b[i+1]='b' and b[i+2]='c':
    count+=1
print(count)

Fixed submission:
n=int(input())
s=input()
count=0
for i in range(n-2):
  if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
    count+=1
print(count)

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

if

Fixed submission:
n=int(input())
s=input()
count=0
for i in range(n-2):
  if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
    count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
if k>=a:
  A=0
  if k-a>=b:
    B=0
  else:
    B=b-(k-a)
else:
  A=a-k
  B=b
print('{}{}'.format(A,B))


Fixed submission:
a,b=input().split()
print(b+a)

Buggy python submission (verdict: Runtime Error):
S=int(input()) 
T=int(input())
print(T+S)

Fixed submission:
a,b=input().split()
print(b+a)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = str(input())
cnt = 0
def f(x):
	tgt = [ x[0], x[1], x[2] ]
	now = 0
	global n
	for i in range(n):
		if s[i] == tgt[now]: now += 1
		if now == 3: return True
	return False
for i in range(1000):
	if len(str(i)) == 1: t = "00"+str(i)
	elif len(str(i)) == 2: t = "0"+str(i)
	else: t = str(i)
	if f(t): cnt += 1
print(cnt)

Fixed submission:
n = int(input())
s = str(input())
cnt = 0
def f(x):
	tgt = [ x[0], x[1], x[2] ]
	now = 0
	global n
	for i in range(n):
		if s[i] == tgt[now]: now += 1
		if now == 3: return True
	return False
for i in range(1000):
	if len(str(i)) == 1: t = "00"+str(i)
	elif len(str(i)) == 2: t = "0"+str(i)
	else: t = str(i)
	if f(t): cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

n,k,q = i2()
ls = [k-q]*n 
for _ in range(q):
	a = i()
	ls[a-1] += 1 

for _ in range(n):
	if ls[j] > 0:
		print("Yes")
	else:
		print("No")

Fixed submission:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

n,k,q = i2()
ls = [k-q]*n 
for _ in range(q):
	a = i()
	ls[a-1] += 1 

for j in range(n):
	if ls[j] > 0:
		print("Yes")
	else:
		print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
d = [int(i) for i in input().split()]

ans = 0
d.sort()

for k in range(n):
	abc = d[0:k]
	arc = d[k:n]
	if len(abc) == len(arc):
		ans = d[k] - d[k-1] 
print(ans)

Fixed submission:
n = int(input())
d = [int(i) for i in input().split()]

ans = 0
d.sort()

abc = d[0:n//2]
arc = d[n//2:n]
if len(abc) == len(arc):
	ans = d[n//2] - d[n//2-1] 
print(ans)
Buggy python submission (verdict: Runtime Error):
x,a = map(int,input().split())
if x <　a:
	print(0)
else:
	print(10)

Fixed submission:
x,a = map(int,input().split())
if x < a:
	print(0)
else:
	print(10)
Buggy python submission (verdict: Runtime Error):
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

n = i()
s = {}
for i in range(n):
	S,P = map(str,input().split())
	s[i+1] = [S, -int(P)]

note = sorted(s.items(), key=lambda x: (x[1][0],x[1][1])
print(note)

Fixed submission:
a,p = map(int,input().split())
print((3*a + p)//2)
Buggy python submission (verdict: Runtime Error):
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a = [str(input()) for _ in range(5)]

n = 9

for i in range(len(a)):
	if int(a[i][-1]) <= n and int(a[i][-1]) != 0 :
		n = int(a[i][-1])
		cnt = i

for i in range(len(a)):
	if i == cnt:
		a[i] = int(a[i])
	elif int(a[i][-1]) == 0:
		a[i] = int(a[i])
	else:
		a[i] = (int(a[i])//10 + 1)*10
print(a)
print(sum(a))

Fixed submission:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a = [str(input()) for _ in range(5)]

n = 10
cnt = 0

for i in range(len(a)):
	if int(a[i][-1]) < n and int(a[i][-1]) != 0 :
		n = int(a[i][-1])
		cnt = i

for i in range(len(a)):
	if i == cnt:
		a[i] = int(a[i])
	elif int(a[i][-1]) == 0:
		a[i] = int(a[i])
	else:
		a[i] = (int(a[i])//10 + 1)*10

print(sum(a))

Buggy python submission (verdict: Runtime Error):
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a = [str(input()) for _ in range(5)]

n = 9

for i in range(len(a)):
	if int(a[i][-1]) < n and int(a[i][-1]) != 0 :
		n = int(a[i][-1])
		cnt = i

for i in range(len(a)):
	if i == cnt:
		a[i] = int(a[i])
	elif int(a[i][-1]) == 0:
		a[i] = int(a[i])
	else:
		a[i] = (int(a[i])//10 + 1)*10
print(sum(a))

Fixed submission:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a = [str(input()) for _ in range(5)]

n = 10
cnt = 0

for i in range(len(a)):
	if int(a[i][-1]) < n and int(a[i][-1]) != 0 :
		n = int(a[i][-1])
		cnt = i

for i in range(len(a)):
	if i == cnt:
		a[i] = int(a[i])
	elif int(a[i][-1]) == 0:
		a[i] = int(a[i])
	else:
		a[i] = (int(a[i])//10 + 1)*10

print(sum(a))
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
print( min(b//a,c)

Fixed submission:
a,b,c = map(int,input().split())
print( min(b//a,c) )
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = [int(i) for i in input().split()]

l.sort()
l.reverse()
cnt = 0
for i in range(n-1):
	cnt += l[i]
if cnt > l[n]:
	print("Yes")
else:
	print("No")

Fixed submission:
n = int(input())
l = [int(i) for i in input().split()]

l.sort()
cnt = 0
for i in range(n-1):
	cnt += l[i]
if cnt > l[n-1]:
	print("Yes")
else:
	print("No")