Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03076 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

l = [a, b, c, d, e]
l_times_ten = []
amari_list = []
for i in range(len(l)):
    amari = l[i] % 10
    if amari == 0:
        l_times_ten.append(l[i])
    elif amari != 0:
        amari_list.append(amari)
        l_tmp =  l[i] +(10 - amari)
        l_times_ten.append(l_tmp)
# print(l_times_ten)
# print(amari_list)
max_total_time = sum(l_times_ten)
# print(min(amari_list))
if len(amari_list) != 0:
    adding = 10 - min(amari_list)
else:
    adding = 0
min_total_time = max_total_time - adding
print(min_total_time)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

l = [a, b, c, d, e]
l_times_ten = []
amari_list = []
for i in range(len(l)):
    amari = l[i] % 10
    if amari == 0:
        l_times_ten.append(l[i])
    elif amari != 0:
        amari_list.append(amari)
        l_tmp =  l[i] +(10 - amari)
        l_times_ten.append(l_tmp)
max_total_time = sum(l_times_ten)
adding = 10 - min(amari_list)
min_total_time = max_total_time - adding
print(min_total_time)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

l = [a, b, c, d, e]
l_times_ten = []
amari_list = []
time = 0
for i in range(len(l)):
    amari = l[i] % 10
    if amari == 0:
        l_times_ten.append(l[i])
    elif amari != 0:
        amari_list.append(amari)
        l_tmp =  l[i] +(10 - amari)
        l_times_ten.append(l_tmp)
max_total_time = sum(l_times_ten)
adding = 10 - min(amari_list)
min_total_time = max_total_time - adding
print(min_total_time)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

l = [a, b, c, d, e]
l_times_ten = []
amari_list = []
time = 0
for i in range(len(l)):
    amari = l[i] % 10
    if amari == 0:
        l_times_ten.append(l[i])
    elif amari != 0:
        amari_list.append(amari)
        l_tmp =  l[i] +(10 - amari)
        l_times_ten.append(l_tmp)
# print(l_times_ten)
# print(amari_list)
max_total_time = sum(l_times_ten)
# print(min(amari_list))
adding = 10 - min(amari_list)
min_total_time = max_total_time - adding
print(min_total_time)
Problem p02748 (python)

Fixed submission:
A,B,M=list(map(int, input().split()))
a=list(map(int, input().split()))
b=list(map(int, input().split()))
mi=min(a)+min(b)
for i in range(0,M):
  Data=list(map(int, input().split()))
  wari=a[Data[0]-1]+b[Data[1]-1]-Data[2]
  if(mi>wari):
    mi=wari
print(mi)

Buggy submission (verdict: Runtime Error):
A,B,M=list(map(int, input().split()))
a=list(map(int, input().split()))
b=list(map(int, input().split()))
mi=min(a)+min(b)
for i in range(0,M):
  Data=list(map(int, input().split()))
  wari=a[Data[0]]+b[Data[1]]-Data[2]
  if(mi>wari):
    mi=wari
print(mi)
Problem p02811 (python)

Fixed submission:
money,sum=map(int,input().split())
money500=500*money
if money500>=sum:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
money,sum=int(input().split())
money500=500*money
if money500>=sum:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
money=int(input().split())
sum=int(input())
money500=500*money
if money500>=sum:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
money=int(input())
sum=int(input())
money500=500*money
if money500>=sum:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
money=input()
sum=input()
money500=500*money
if money500>=sum:
    print('Yes')
else:
    print('No')
return 0

Buggy submission (verdict: Runtime Error):
money=input()
sum=input()
money500=500*money
if money500>=sum:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
money=input()
sum=input()
money500=500*money
if money500>=sum:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
money=input()
sum=input()
money500=500*money
if money500>=sum:
    print('Yes')
else:
    print('No')
Problem p02783 (python)

Fixed submission:
input_1 = input()
mylist = list(map(int, input_1.split(" ")))
H = mylist[0]
A = mylist[1]
if H % A != 0:
  answer = H//A + 1
else:
  answer = H//A
print(answer)

Buggy submission (verdict: Runtime Error):
mylist = list(map(int, myinput.split(" ")))
H = mylist[0]
A = mylist[1]
x = 0
while H >0:
  H -= A
  x += 1
print(x)

Buggy submission (verdict: Runtime Error):
mylist = list(map(int, myinput.split(" ")))
H = mylist[0]
A = mylist[1]
H // A = C
print(C)

Buggy submission (verdict: Runtime Error):
input_1 = input()
mylist = list(map(int, input_1.split(" ")))
H = mylist[0]
A = mylist[1]
if H % A =! 0:
  answer = H//A + 1
else:
  anser = H//A
print(answer)

Buggy submission (verdict: Runtime Error):
input_1 = input("")
mylist = list(map(int, input_1.split(" ")))
H = mylist[0]
A = mylist[1]
if H % A =! 0:
  answer = H//A + 1
else:
  anser = H//A
print(answer)
Problem p03059 (python)

Fixed submission:
A, B, T = map(int, input().split())

print( B * int((T + 0.5)/A) )

Buggy submission (verdict: Runtime Error):
A, B, T = [input(), input(), input()]

print( B * int((T + 0.5)/A) )

Buggy submission (verdict: Runtime Error):
print( B * int((T + 0.5)/A) )
Problem p03060 (python)

Fixed submission:
N = int(input())
V = [int(x.strip()) for x in input().split()]
C = [int(x.strip()) for x in input().split()]

Z = [V[i] - C[i] for i in range(N)]
print(sum([z for z in Z if z > 0]))

Buggy submission (verdict: Runtime Error):
X = [0 for i in range(2**N)]
Y = [0 for i in range(2**N)]
Z = [0 for i in range(2**N)]

for i in range(2**N):
    select = []
    if i > 0:
        temp = i
        for n in reversed(range(1, N+1)):
            if temp - 2**(n-1) >= 0:
                temp = temp - 2**(n-1)
                select.append(n-1)
            else:
                pass
        X[i] = sum([V[i] for i in select])
        Y[i] = sum([C[i] for i in select])
        Z[i] = X[i] - Y[i]
print(max(Z))
Problem p02765 (python)

Fixed submission:
N,R=map(int,input().split())
ans=0
if N>=10:
  ans=R
  
else:
  ans=R+100*(10-N)
 
print(ans)

Buggy submission (verdict: Runtime Error):
N,R=int(input( ).split( ))
ans=0
if N>=10:
  ans=R
  
else:
  ans=R+100*(10-N)
 
print(ans)

Buggy submission (verdict: Runtime Error):
N,R=int(input().split())
ans=0
if N>=10:
  ans=R
  
else:
  ans=R+100*(10-N)
 
print(ans)

Buggy submission (verdict: Runtime Error):
N,R=int(input().split())
ans=0
if N>=10:
  ans=R
  
else:
  ans=R-100*(10-N)
 
print(ans)
Problem p02772 (python)

Fixed submission:
N=int(input())
data=list(map(int,input().split()))
ans="APPROVED"
for i in range(N):
    mo2=data[i]%2
    mo6=data[i]%6
    mo10=data[i]%10
    if mo2==0:
        if mo6==0 or mo10==0:
            ans="APPROVED"

        else:
            ans="DENIED"
            break
    else:
        continue
print(ans)

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

for i in range(N):
    mo2=data[i]%2
    mo6=data[i]%6
    mo10=data[i]%10
    if mo2==0:
        if mo6==0 or mo10==0:
            ans="APPROVED"

        else:
            ans="DENIED"
            break

print(ans)

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

for i in range(N):
    mo2=data[i]%2
    mo6=data[i]%6
    mo10=data[i]%10
    if mo2==0:
        if mo6==0 or mo10==0:
            ans="APPROVED"
            continue
        else:
            ans="DENIED"
            break
    else:
        continue
print(ans)

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

for i in range(N):
    mod2=data[i]%2
    mod6=data[i]%6
    mod10=data[i]%10
    if mod2==0:
        if mod6==0 or mod10==0:
            ans="APPROVED"
            continue
        else:
            ans="DENIED"
            break
    else:
        continue
print(ans)
Problem p02789 (python)

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

if N==M:
    print("Yes")

if N!=M:
    print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
data = list(map(int, input().split()))
ans=1
if N>1:
    for i in range(1,N):
        if data[i]<=data[i-1]:
            ans+=1
print(ans)
Problem p02791 (python)

Fixed submission:
N=int(input())
data = list(map(int, input().split()))
ans=1
minmin=data[0]
if N==1:
    ans=1
elif N>1:
    minmin=data[0]
    for i in range(1,N):

        if data[i]<=minmin:
            minmin=data[i]
            #if minmin<=data[i]:
            ans+=1
                #continue
        #if minmin<=data[i]:
            #ans+=1

print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
data = list(map(int, input().split()))
ans=1
if N>1:
    for i in range(1,N+1):
        if data[i]<=data[i-1]:
            ans+=1
print(ans)
Problem p02795 (python)

Fixed submission:
import math

H=int(input())
W=int(input())
N=int(input())

if W>H :
    if N%W==0:
        k=N/W
    else:
        k=math.ceil(N/W)
else:
    if N%H==0:
        k=N/H
    else:
        k=math.ceil(N/H)

k=int(k)
print(k)

Buggy submission (verdict: Runtime Error):
H=int(input())
W=int(input())
N=int(input())
 
if W>H :
    if N%W==0:
        k=N/W
    else:
        k=math.ceil(N/W)
if H>=W:
    if N%H==0:
        k=N/H
    else:
        k=math.ceil(N/H)
 
 
print(int(k))

Buggy submission (verdict: Runtime Error):
H=int(input())
W=int(input())
N=int(input())

if W>H :
    k=int(N/W)+1
else
    k=int(H/W)+1


print(k)

Buggy submission (verdict: Runtime Error):
import math

H=input()
W=input()
N=input()

k=W-3*H-math.sqrt((w-3h)**2-(w-h)**2+4N)
k=int(k)+1

print(k)
Problem p03000 (python)

Fixed submission:
N,X = map(int,input().split())
bound_limit= N+1
L = list(map(int,input().split()))
sum=0
count=1
for i in range(0,len(L)):
  sum+=L[i]
  if sum<=X:
    count+=1
  else:
    break
print(count)

Buggy submission (verdict: Runtime Error):
N,X = map(int,input().split())
bound_limit= N+1
L = list(map(int,input().split()))
sum=0
count=1
for i in range(0,len(L)):
  sum+=L[i]
  if sum<=x:
    count+=1
  else:
    break
print(count)

Buggy submission (verdict: Runtime Error):
N,X = map(int,input().split())
bound_limit= N+1
L = list(map(int,input().split()))
sum=0
count=1
for i in range(len(L)):
  sum+=L[i]
  if sum<=x:
    count+=1
  else:
    break
print(count)
Problem p03001 (python)

Fixed submission:
W,H,x,y = map(int,input().split())
max=W*H/2
xx=W/2
yy=H/2
if xx==x and yy==y:
  check=1
else:
  check=0
  
print(max,check)

Buggy submission (verdict: Runtime Error):
W,H,x,y= map(int,input().split())
max=W*H/2
if x=W or y=H:
  check=0
else:
  check=1

print(max,check)
Problem p03337 (python)

Fixed submission:
a=list(map(int,input( ).split( )))
b=a[0]+a[1]
c=a[0]-a[1]
d=a[0]*a[1]
e=max(b,c,d)
print (e)

Buggy submission (verdict: Runtime Error):
N=int(input())
s=[x for x in input()]
#print(s)
answers=[]

for i in range(1,N+1):
    sl=s[:i]
    #print(sl)
    sr=s[i:N]

    l=sl.count("W")
    r=sr.count("E")

    ans=l+r
    #print(ans)
    answers.append(ans)
fa=min(a for a in answers)
print(fa)

Buggy submission (verdict: Runtime Error):
a,b=map(int, raw_input.split( ))
c=max(a+b,a-b,a*b)
print c
Problem p02748 (python)

Fixed submission:
# -*- coding: utf-8 -*-
A, B, M = map(int,  input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

sum = []
for i in range(M):
        x, y, c = map(int,  input().split())
        sum.append(a[x-1]  + b[y-1] - c)

a.sort()
b.sort()

sum.append(a[0] + b [0])

sum.sort()

i=0
while sum[i] < 0:
        i+=0
print(sum[i])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
A, B, M = map(int,  input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
sum = [0.0] * (A * B)

for i in range(M):
        x, y, c = map(int,  input().split())
        sum[(y-1)*A + (x-1)] -= c

for ia in range(A):
        for ib in range(B):
                sum[ib*A + ia] += a[ia] + b[ib]

sum.sort()

i=0
while sum[i] < 0:
        i+=0
print(int(sum[i]))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
A, B, M = map(int,  input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
sum = [0.0] * (A * B)

for i in range(M):
        x, y, c = map(int,  input().split())
        sum[(y-1)*A + (x-1)] -= c

for ia in range(A):
        for ib in range(B):
                sum[ib*A + ia] += a[ia] + b[ib]

sum.sort()

i=0
while sum[i] < 0:
        i+=0
print(sum[i])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
A, B, M = map(int,  input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
sum = [0] * (A * B)

for i in range(M):
        x, y, c = map(int,  input().split())
        sum[(y-1)*A + (x-1)] = -c

for ia in range(A):
        for ib in range(B):
                sum[ib*A + ia] += a[ia] + b[ib]

sum.sort()

i=0
while sum[i] < 0:
        i+=0
print(sum[i])
Problem p02778 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import re
s = input()
print(re.sub('[a-z]', 'x', s))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
print(re.sub('[a-z]', 'x', input()))

Buggy submission (verdict: Runtime Error):
-*- coding: utf-8 -*-
print(re.sub('[a-z]', 'x', input()))
Problem p03047 (python)

Fixed submission:
n , k = map(int , input().split())
ans = n - k + 1
print(ans)

Buggy submission (verdict: Runtime Error):
n , k = map(int , input(),split())
ans = n - k + 1
print(ans)
Problem p02760 (python)

Fixed submission:
bingo = []
tmp = input()
bingo.append(tmp.split(' '))
tmp = input()
bingo.append(tmp.split(' '))
tmp = input()
bingo.append(tmp.split(' '))
for i in range(len(bingo)):
    bingo[i] = [int(bingo[i][0]), int(bingo[i][1]), int(bingo[i][2])]

n = input()
data = []
arr = range(int(n))
arr = list(arr)
for count in arr:
    tmp = input()
    data.append(int(tmp))

ans = []
for num in data:
    for i in range(len(bingo)):
        for j in [0, 1, 2]:
            if bingo[i][j] is num:
                ans.append([i, j])

# 1 2 3
# 4 5 6
# 7 8 9

# 6 15 12 15 15 24 18
# more 3

# 11 12 13
# 21 22 23
# 31 32 33

if [0, 0] in ans and [0, 1] in ans and [0, 2] in ans:
    print('Yes')
    exit(0)

if [1, 0] in ans and [1, 1] in ans and [1, 2] in ans:
    print('Yes')
    exit(0)

if [2, 0] in ans and [2, 1] in ans and [2, 2] in ans:
    print('Yes')
    exit(0)

if [0, 0] in ans and [1, 0] in ans and [2, 0] in ans:
    print('Yes')
    exit(0)

if [0, 1] in ans and [1, 1] in ans and [2, 1] in ans:
    print('Yes')
    exit(0)

if [0, 2] in ans and [1, 2] in ans and [2, 2] in ans:
    print('Yes')
    exit(0)

if [0, 0] in ans and [1, 1] in ans and [2, 2] in ans:
    print('Yes')
    exit(0)

if [0, 2] in ans and [1, 1] in ans and [2, 0] in ans:
    print('Yes')
    exit(0)

print('No')

Buggy submission (verdict: Runtime Error):
bingo = []
tmp = input()
bingo.append(tmp.split(' '))
tmp = input()
bingo.append(tmp.split(' '))
tmp = input()
bingo.append(tmp.split(' '))
for i in len(bingo):
    bingo[i] = [int(bingo[i][0]), int(bingo[i][1]), int(bingo[i][2])]

n = input()
data = []
arr = range(int(n))
arr = list(arr)
for count in arr:
    tmp = input()
    data.append(int(tmp))

ans = []
for num in data:
    for i in len(bingo):
        for j in [0, 1, 2]:
            if bingo[i][j] is num:
                ans.append([i, j])

# 1 2 3
# 4 5 6
# 7 8 9

# 6 15 12 15 15 24 18
# more 3

# 11 12 13
# 21 22 23
# 31 32 33

if [0, 0] in ans and [0, 1] in ans and [0, 2] in ans:
    print('Yes')
    exit(0)

if [1, 0] in ans and [1, 1] in ans and [1, 2] in ans:
    print('Yes')
    exit(0)

if [2, 0] in ans and [2, 1] in ans and [2, 2] in ans:
    print('Yes')
    exit(0)

if [0, 0] in ans and [1, 0] in ans and [2, 0] in ans:
    print('Yes')
    exit(0)

if [0, 1] in ans and [1, 1] in ans and [2, 1] in ans:
    print('Yes')
    exit(0)

if [0, 2] in ans and [1, 2] in ans and [2, 2] in ans:
    print('Yes')
    exit(0)

if [0, 0] in ans and [1, 1] in ans and [2, 2] in ans:
    print('Yes')
    exit(0)

if [0, 2] in ans and [1, 1] in ans and [2, 0] in ans:
    print('Yes')
    exit(0)

print('No')
Problem p02795 (python)

Fixed submission:
import math
H=int(input())
W=int(input())
N=int(input())
if H>=W:
    print(str(math.ceil(N/H)))
else:
    print(str(math.ceil(N/W)))

Buggy submission (verdict: Runtime Error):
N=int(input())
robbot=[input().split() for i in range(N)]
roba=[x[0] for x in robbot]
robb=[x[1] for x in robbot]
robc=list(map(int,roba))
robd=list(map(int,robb))
tas1=[x+y for (x,y) in zip (robc,robd)]
tas2=[x-y for (x,y) in zip (robc,robd)]
del tas2[0]
del tas1[-1]
tas3=[x-y for (x,y) in zip (tas2,tas1)]
tas4=[i for i in tas3 if i>=0 or i-1>=0]
print(len(tas4))

Buggy submission (verdict: Runtime Error):
N=int(input())
robbot=[input().split() for i in range(N)]
roba=[x[0] for x in robbot]
robb=[x[1] for x in robbot]
robc=list(map(int,roba))
robd=list(map(int,robb))
tas1=[x+y for (x,y) in zip (robc,robd)]
tas2=[x-y for (x,y) in zip (robc,robd)]
del tas2[0]
del tas1[-1]
tas3=[x-y for (x,y) in zip (tas2,tas1)]
tas4=[i for i in tas3 if i>=0]
print(len(tas4)+1)
Problem p02817 (python)

Fixed submission:
S=list(input().split())
print(S[1]+S[0])

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
U=T+S
Print(U)
Problem p02975 (python)

Fixed submission:
def main(N):
	a = list(map(int, input().split()))
	if a.count(0) == N:
		print("Yes")
		return
	if N%3 != 0:
		print("No")
		return
	d={}
	for i in a:
		if i in d:
			d[i] = d[i] + 1
		else:
			d[i] = 1
	if 0 in d.keys():
		if d[0] == N//3:
			for i in d.keys():
				if i == 0:
					continue
				elif d[i] % 2 != 0:
					print("No")
					return
			print("Yes")
		else:
			print("No")
	else:
		for i in d.values():
			if i != N//3:
				print("No")
				return
		lst = list(d.keys())
		if (lst[0]^lst[2]!=lst[1]) or (lst[0] != lst[1]^lst[2]) or(lst[2]!=lst[1]^lst[0]):
			print("No")
			return
		print("Yes")
	return
		
	return

main(int(input()))

Buggy submission (verdict: Runtime Error):
def main(N):
	a = list(map(int, input().split()))
	if a.count(0) == N:
		print("Yes")
		return
	if N%3 != 0:
		print("No")
		return
	d={}
	for i in a:
		if i in d:
			d[i] = d[i] + 1
		else:
			d[i] = 1
	if 0 in d.keys():
		if d[0] == N//3:
			for i in d.keys():
				if i == 0:
					continue
				elif d[i] % 2 != 0:
					print("No")
					return
			print("Yes")
		else:
			print("No")
	else:
		for i in d.values():
			if i != N//3:
				print("No")
				return
		lst = d.keys()
		if (lst[0]^lst[2]!=lst[1]) or (lst[0] != lst[1]^lst[2]) or(lst[2]!=lst[1]^lst[0]):
			print("No")
			return
		print("Yes")
	return
		
	return

main(int(input()))
Problem p03416 (python)

Fixed submission:
def main():
	n = list(map(int, input().split()))
	ans = 0
	for i in range(n[0], n[1]+1):
		temp = str(i)
		if temp == temp[::-1]:
			ans += 1
	print(ans)
main()

Buggy submission (verdict: Runtime Error):
def main():
	n = list(map(int, input().split()))
	ans = 0
	for i in range(n[0], n[1]+1):
		temp = str(i)
		if temp == temp[::-1]:
			an += 1
	print(ans)
main()
Problem p04043 (python)

Fixed submission:
l = [0]*11
r = list(map(int,input().split()))
for i in r:
  l[i] += 1
print("YES" if (l[5]==2)and(l[7]==1) else "NO")

Buggy submission (verdict: Runtime Error):
l = [0]*11
r = list(map(int,input().split()))
for i in r:
  l[r] += 1
print("YES" if (l[5]==2)and(l[7]==1) else "NO")
Problem p02760 (python)

Fixed submission:
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
B = [int(input()) for i in range(N)]

cards = A[0] + A[1] + A[2]

for b in B:
    cards = [c if c != b else 0 for c in cards]

if (sum(cards[0:3]) == 0):
    print('Yes')
elif (sum(cards[3:6]) == 0):
    print('Yes')
elif (sum(cards[6:9]) == 0):
    print('Yes')
elif ((cards[0] + cards[3] + cards[6]) == 0):
    print('Yes')
elif ((cards[1] + cards[4] + cards[7]) == 0):
    print('Yes')
elif ((cards[2] + cards[5] + cards[8]) == 0):
    print('Yes')
elif ((cards[0] + cards[4] + cards[8]) == 0):
    print('Yes')
elif ((cards[2] + cards[4] + cards[6]) == 0):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
B = [int(input()) for i in range(N)]

cards = A[0] + A[1] + A[2]

for b in B:
    cards = [c if c != b else 0 for c in cards]

if (sum(A[0:3]) == 0):
    print('Yes')
elif (sum(A[3:6]) == 0):
    print('Yes')
elif (sum(A[7:9]) == 0):
    print('Yes')
elif ((A[0] + A[3] + A[6]) == 0):
    print('Yes')
elif ((A[1] + A[4] + A[7]) == 0):
    print('Yes')
elif ((A[2] + A[5] + A[8]) == 0):
    print('Yes')
elif ((A[0] + A[4] + A[8]) == 0):
    print('Yes')
elif ((A[2] + A[4] + A[6]) == 0):
    print('Yes')
else:
    print('No')
Problem p02801 (python)

Fixed submission:
S = input()

alp = 'abcdefghijklmnopqrstuvwxyz'
ans = alp[(alp.index(S) + 1)]
print(ans)

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

alp = 'abcdefghijklmnopqrstuvwxyz'
ans = alp[(alp.index(N) + 1)]
print(ans)

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

alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = alp[(alp.index(N) + 1)]
print(ans)
Problem p02812 (python)

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

ans = S.count('ABC')
print(ans)

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

ans = 0
while 'ABC' in S:
    ans += 1
    S.remove('ABC')

print(ans)
Problem p02886 (python)

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

ans = 0
for i in range(0, N):
    for j in range(i+1, N):
        ans += (D[i] * D[j])
print(ans)

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

ans = 0
for i in range(0, N):
    for j in range(i, N+1):
        ans += (D[i] * D[j])
print(ans)
Problem p02982 (python)

Fixed submission:
import numpy as np


N, D = list(map(int, input().split()))
X = [list(map(int, input().split())) for i in range(N)]

ans = 0
for i in range(N):
    for j in range(i + 1, N):
        dis = np.linalg.norm(np.array(X[i]) - np.array(X[j]))
        if dis - int(dis) < 0.00000001:
            ans += 1
print(ans)

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


N, D = list(map(int, input().split()))
X = [list(map(int, input().split())) for i in range(N)]

ans = 0
for i in range(N):
    for j in range(i + 1, N):
        dis = np.linalg.norm(np.array(X[i]) - np.array(X[j]))
        if dis - int(dis) < 0.00000001:
            ans += 1
print(ans)
Problem p03043 (python)

Fixed submission:
import math


N, K = list(map(int, input().split()))

ans = 0

for n in range(1, N+1):
    # 2^(num_success) * n >= K なる num_success
    # 2^(num_success) >= K/n
    # num_success >= log_2(K/n)
    num_success = max(0, math.ceil(math.log2(K/n)))
    ans += (1/2) ** num_success

print(ans/N)

Buggy submission (verdict: Runtime Error):
def dfs(node, distance):
    for next_node, edge_size in G[node]:
        if ans[next_node] == -1:
            ans[next_node] = ((distance+edge_size) % 2)
            dfs(next_node, distance+edge_size)


N = int(input())

G = [[] for i in range(N)]
for i in range(N-1):
    u, v, w = map(int, input().split())
    G[u-1].append([v-1, w])
    G[v-1].append([u-1, w])

ans = [-1]*N
dfs(0, 0)
print(*ans, sep='\n')

Buggy submission (verdict: Runtime Error):
import math


N, K = list(map(int, input().split()))

ans = 0

for n in range(1, N+1):
    # 2^(num_success) * n >= K なる num_success
    # 2^(num_success) >= K/n
    # num_success >= log_2(K/n)
    num_success = max(0, math.ceil(math.log2(K/n)))
    ans += (1/2) ** num_success

print(ans/N)