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

Fixed submission:
def solve():
    N = int(input())
    A = list(map(int, input().split()))
    M = 0
    ret_M = []
    memo_N = [0]*N # memo: 倍数を足したときに2で割った余り
    for i in range(N)[::-1]:
        i_ = i+1
        q = N//i_
        s = sum(memo_N[i_*(d+1)-1] for d in range(1,q))
        memo_N[i] = (s%2)^A[i]
        if memo_N[i]:
            M += 1
            ret_M.append(i_)
                
    print(M)
    if M: print(' '.join(map(str, ret_M[::-1])))
      
solve()

Buggy submission (verdict: Runtime Error):
def solve():
    N = int(input())
    A = list(map(int, input().split()))
    M = 0
    ret_M = []
    memo_N = [-1]*N # memo: 倍数を足したときに2で割った余り
    for i in range(N)[::-1]:
        i_ = i+1
        q = N//i_
        
        if q == 1:
            memo_N[i] = A[i]
            if A[i] == 1:
                M += 1
                ret_M.append(i_)
        else:
            memo_N[i] = memo_N[i_*2]^A[i]
            if memo_N[i]:
                M += 1
                ret_M.append(i_)
                
    print(M)
    if M: print(' '.join(map(str, ret_M[::-1])))
      
solve()
Problem p02982 (python)

Fixed submission:
import itertools
import math

dist = lambda X,Y: math.sqrt(sum((x-y)**2 for x,y in zip(X,Y)))

def solve():
    N, D = [int(s) for s in input().split() if s]
    X = []
    cnt = 0
    for _ in range(N):
        X.append([int(s) for s in input().split() if s])
    for x1,x2 in itertools.combinations(X,2):
        if dist(x1,x2).is_integer():
            cnt+=1
    print(cnt)

solve()

Buggy submission (verdict: Runtime Error):
import itertools
import math

def solve():
  N, D = [int(s) for s in input().split() if s]
  X = []
  cnt = 0
  for _ in range(N):
    X.append([int(s) for s in input().split() if s])
    for x1,x2 in itertools.combinations(X,2):
      if dist(x1,x2).is_integer():
        cnt+=1
    print(cnt)

solve()

Buggy submission (verdict: Runtime Error):
import itertools
import math

def solve():
    N, D = [int(s) for s in input().split() if s]
    X = []
    cnt = 0
    for _ in range(N):
        X.append([int(s) for s in input().split() if s])
    for x1,x2 in itertools.combinations(X,2):
        if dist(x1,x2).is_integer():
            cnt+=1
    print(cnt)
    
solve()
Problem p03651 (python)

Fixed submission:
from fractions import gcd
import functools

def gcd_list(l):
    return functools.reduce(gcd, l)

def solve():
    N,K = map(int, input().split())
    A = list(map(int, input().split()))
    d = gcd_list(A)
    ret = False
    if K > max(A):
        print('IMPOSSIBLE')
        return
    
    for a in A:
        if (a-K)%d == 0:
            ret = True
            break
            
    print('POSSIBLE' if ret else 'IMPOSSIBLE')
    
solve()

Buggy submission (verdict: Runtime Error):
from math import gcd
import functools

def gcd_list(l):
    return functools.reduce(gcd, l)

def solve():
    N,K = map(int, input().split())
    A = list(map(int, input().split()))
    d = gcd_list(A)
    ret = False
    if K > max(A):
        print('IMPOSSIBLE')
        return
    
    for a in A:
        if (a-K)%d == 0:
            ret = True
            break
            
    print('POSSIBLE' if ret else 'IMPOSSIBLE')
    
solve()
Problem p03730 (python)

Fixed submission:
import fractions
 
A,B,C = map(int, input().split())
 
ret = C % fractions.gcd(A,B) == 0
print('YES' if ret else 'NO')

Buggy submission (verdict: Runtime Error):
import math

A,B,C = map(int, input().split())

ret = C % math.gcd(A,B) == 0
print('Yes' if ret else 'No')
Problem p03830 (python)

Fixed submission:
# 100以下の素数を求める
primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
pi_100 = len(primes)

mod = 10**9+7

prime_vector = [0]*pi_100

N = int(input())
for n in range(2,N+1):
    # calc prime
    for i in range(pi_100):
        while n % primes[i] == 0:
            prime_vector[i] += 1
            n = n//primes[i]

ret = 1

# print(prime_vector)
for i in range(pi_100):
    ret = (ret * (prime_vector[i]+1)) % mod

print(ret)

Buggy submission (verdict: Runtime Error):
# 100以下の素数を求める
primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
pi_100 = len(primes)

mod = 10**9+7

prime_vector = [0]*pi_100

N = int(input())
for n in range(2,N+1):
    ret = (get_div_num(n)*ret)%mod
    # calc prime
    for i in range(pi_100):
        while n % primes[i] == 0:
            prime_vector[i] += 1
            n = n//primes[i]

ret = 1

# print(prime_vector)
for i in range(pi_100):
    ret = (ret * (prime_vector[i]+1)) % mod

print(ret)
Problem p03837 (python)

Fixed submission:
MAX_D = 10**9
def solve():
    N,M = map(int, input().split())
    d = [[MAX_D]*N for _ in range(N)]
    edges = [[False]*N for _ in range(N)]
    base_edge = {}
    for _ in range(M):
        a,b,c = map(int, input().split())
        edges[a-1][b-1] = True
        edges[b-1][a-1] = True
        d[a-1][b-1] = c
        d[b-1][a-1] = c
        base_edge[(a-1,b-1)] = c
        base_edge[(b-1,a-1)] = c
        
    # ワーシャルフロイド法
    for k in range(N):
        for i in range(N):
            for j in range(N):
                if i != j and d[i][j] > d[i][k]+d[k][j]:
                    # print(i+1,k+1,j+1, d[i][j], d[i][k], d[k][j])
                    edges[i][j] = False
                    if (i,k) in base_edge and base_edge[(i,k)] == d[i][k]: edges[i][k] = True
                    if (k,j) in base_edge and base_edge[(k,j)] == d[k][j]: edges[k][j] = True
                    d[i][j] = d[i][k]+d[k][j]
                    
    # print(edges)
    print(M - sum(map(sum, edges))//2)
    
solve()

Buggy submission (verdict: Runtime Error):
MAX_D = 10**9
def solve():
    N,M = map(int, input().split())
    d = [[MAX_D]*N for _ in range(N)]
    edges = [[False]*N for _ in range(N)]
    base_edge = {}
    for _ in range(M):
        a,b,c = map(int, input().split())
        edges[a-1][b-1] = True
        edges[b-1][a-1] = True
        d[a-1][b-1] = c
        d[b-1][a-1] = c
        base_edge[(a-1,b-1)] = c
        base_edge[(b-1,a-1)] = c
        
    # ワーシャルフロイド法
    for k in range(N):
        for i in range(N):
            for j in range(N):
                if i != j and d[i][j] > d[i][k]+d[k][j]:
                    # print(i+1,k+1,j+1, d[i][j], d[i][k], d[k][j])
                    edges[i][j] = False
                    if base_edge[(i,k)] == d[i][k]: edges[i][k] = True
                    if base_edge[(k,j)] == d[k][j]: edges[k][j] = True
                    d[i][j] = d[i][k]+d[k][j]
                    
    # print(edges)
    print(M - sum(map(sum, edges))//2)
    
solve()
Problem p02727 (python)

Fixed submission:
X,Y,A,B,C=map(int,input().split())
p=sorted(map(int,input().split()))
q=sorted(map(int,input().split()))
r=sorted(map(int,input().split()))
ans=[]
ans+=p[A-X:]
ans+=q[B-Y:]
ans.sort()
j=0
k=0
for i in ans:
	if len(r)>1:
		k=r[-1]
	elif len(r)==1:
		k=r[0]
	else:
		break
	if i<k:
		ans[j]=r.pop()
		j+=1
	else:
		break
print(sum(ans))

Buggy submission (verdict: Runtime Error):
X,Y,A,B,C=map(int,input().split())
p=sorted(map(int,input().split()))
q=sorted(map(int,input().split()))
r=sorted(map(int,input().split()))
ans=[]
ans+=p[A-X:]
ans+=q[B-Y:]
ans.sort()
j=0
for i in ans:
	if i<r[-1]:
		ans[j]=r.pop()
		j+=1
	else:
		break
print(sum(ans))

Buggy submission (verdict: Runtime Error):
X,Y,A,B,C=map(int,input().split())
p=sorted(map(int,input().split()))
q=sorted(map(int,input().split()))
r=sorted(map(int,input().split()))
ans=[]
ans+=p[A-X:]
ans+=q[B-Y:]
ans.sort()
i=0
for i in ans:
	if i<r[-1]:
		ans[i]=r.pop()
	else:
		break
print(sum(ans))

Buggy submission (verdict: Runtime Error):
X,Y,A,B,C=map(int,input().split())
p=sorted(map(int,input().split()))
q=sorted(map(int,input().split()))
r=sorted(map(int,input().split()))
ans=[]
ans+=p[A-X:]
ans+=q[B-Y:]
ans.sort()
i=0
j=0
for i in ans:
	j=max(r)
	if i<j:
		ans[i]=r.pop()
print(sum(ans))

Buggy submission (verdict: Runtime Error):
X,Y,A,B,C=map(int,input().split())
p=sorted(map(int,input().split()))
q=sorted(map(int,input().split()))
r=sorted(map(int,input().split()))
ans=[]
ans+=p[A-X:]
ans+=q[B-Y:]
i=0
j=0
while True:
	i=max(r)
	j=min(ans)
	if i>j:
		ans.remove(j)
		ans.append(i)
		r.remove(i)
	else:
		break
print(sum(ans))
Problem p02756 (python)

Fixed submission:
import sys
from collections import deque
S=[input()]
S=deque(S)
Q=int(sys.stdin.readline())
flag=0
for i in range(Q):
	qu=tuple(input().split())
	if qu[0]=='1':
		if flag==0:
			flag+=1
		else:
			flag=0
	else:
		if qu[1]=='1' and flag==0:
			S.appendleft(qu[2])
		elif qu[1]=='1' and flag==1:
			S.append(qu[2])
		elif qu[1]=='2' and flag==0:
			S.append(qu[2])
		elif qu[1]=='2' and flag==1:
			S.appendleft(qu[2])
if flag==1:
	S=''.join(S)
	S=S[::-1]
	print(S)
	exit()
print(''.join(S))

Buggy submission (verdict: Runtime Error):
import sys
from collections import deque
	S=[input()]
	S=deque(S)
	Q=int(sys.stdin.readline())
	flag=0
	for i in range(Q):
		qu=tuple(input().split())
		if qu[0]=='1':
			if flag==0:
				flag+=1
			else:
				flag=0
		else:
			if qu[1]=='1' and flag==0:
				S.appendleft(qu[2])
			elif qu[1]=='1' and flag==1:
				S.append(qu[2])
			elif qu[1]=='2' and flag==0:
				S.append(qu[2])
			elif qu[1]=='2' and flag==1:
				S.appendleft(qu[2])
	if flag==1:
		S.reverse()
	print(''.join(S))
Problem p02761 (python)

Fixed submission:
N,M=map(int,input().split())
s=[0]*M
c=[0]*M
a=0
for i in range(M):
	s[i],c[i]=map(int,input().split())
ans=-1
if M==0:
	ans=1*(10**(N-1))
	if ans==1:
		ans=0
	print(ans)
	exit()
if max(s)>N:
	print(ans)
	exit()
for j in range(0,1000):
	value=str(j)
	if len(value)==N:
		for S,C in zip(s,c):
			if int(value[S-1])==C:
				a+=1
		if a==M:
			ans=int(j)
			break
		else:
			a=0
	else:
		continue
print(ans)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
s=[0]*M
c=[0]*M
a=0
for i in range(M):
	s[i],c[i]=map(int,input().split())
ans=-1
if M==0:
	ans=1*(10**(N-1))
	print(ans)
if max(s)>N:
	print(ans)
	exit()
for j in range(0,1000):
	value=str(j)
	if len(value)==N:
		for S,C in zip(s,c):
			if int(value[S-1])==C:
				a+=1
		if a==M:
			ans=int(j)
			break
		else:
			a=0
	else:
		continue
print(ans)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
s=[0]*M
c=[0]*M
a=0
for i in range(M):
	s[i],c[i]=map(int,input().split())
ans=-1
if max(s)>N:
	print(ans)
	exit()
for j in range(0,1000):
	value=str(j)
	if len(value)==N:
		for S,C in zip(s,c):
			if int(value[S-1])==C:
				a+=1
		if a==M:
			ans=int(j)
			break
		else:
			a=0
	else:
		continue
print(ans)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
s=[0]*M
c=[0]*M
a=0
for i in range(M):
	s[i],c[i]=map(int,input().split())
ans=-1
if max(s)>N:
	print(ans)
	exit()
for j in range(1,1000):
	value=str(j)
	if len(value)==N:
		for S,C in zip(s,c):
			if int(value[S-1])==C:
				a+=1
		if a==M:
			ans=int(j)
			break
		else:
			a=0
	else:
		continue
print(ans)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
s=[0]*M
c=[0]*M
a=0
for i in range(M):
	s[i],c[i]=map(int,input().split())
ans=-1
for j in range(1,1000):
	value=str(j)
	if max(s)>N:
		break
	if len(value)==N:
		for S,C in zip(s,c):
			if int(value[S-1])==C:
				a+=1
		if a==M:
			ans=int(j)
			break
		else:
			a=0
	else:
		continue
print(ans)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
s=[0]*M
c=[0]*M
a=0
for i in range(M):
	s[i],c[i]=map(int,input().split())
ans=-1
for j in range(1,1000):
	value=str(j)
	if len(value)==N:
		if max(s)<=N:
			for S,C in zip(s,c):
				if int(value[S-1])==C:
					a+=1
			if a==M:
				ans=int(j)
				break
			else:
				a=0
		else:
			continue
	else:
		continue
print(ans)

Buggy submission (verdict: Runtime Error):
N,M=map(int, input().split())
s=[0]*M
c=[0]*M
x=[0]*M
h=0
y=0
z=1
for i in range(M):
	s[i],c[i]=map(int, input().split())
	y=s[i]-1
	x[y]=c[i]
if len(x)==N:
	x.reverse()
	for j in x:
		h=h+j*z
		z=10*z
	print(h)
else:
	print('-1')
Problem p02789 (python)

Fixed submission:
N,M=map(int, input().split())
 
if N==M:
	print('Yes')
else:
	print('No')

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

if X==M:
	print('Yes')
else:
	print('No')
Problem p02909 (python)

Fixed submission:
s=input()
if s=='Sunny':
	print('Cloudy')
elif s=='Rainy':
	print('Sunny')
else:
	print('Rainy')

Buggy submission (verdict: Runtime Error):
if input()=='Sunny':
	print('Cloudy')
elif input()=='Rainy':
	print('Sunny')
else:
	print('Rainy')
Problem p02945 (python)

Fixed submission:
a,b = map(int,input().split())
wa = a + b
sa = a - b
seki = a * b
list = [wa,sa,seki]
print(max(list))

Buggy submission (verdict: Runtime Error):
a,b = int(input()).split()
wa = a + b
sa = a - b
seki = a * b
list = [wa,sa,seki]
print(max(list))

Buggy submission (verdict: Runtime Error):
a,b = int(input().split())
wa = a + b
sa = a - b
seki = a * b
list = [wa,sa,seki]
print(max(list))
Problem p02952 (python)

Fixed submission:
N = int(input())
ans = 0
for i in range(1, N + 1):
	if len(str(i)) % 2 == 1:
		ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 0
for i in range(1, N + 1):
if len(i) % 2 == 1:
ans += 1
print(ans)
Problem p02957 (python)

Fixed submission:
a,b=map(int,input().split())
if a%2 != b%2:
	print("IMPOSSIBLE")
else:
	k=(a+b)//2
	print(k)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a%2 != b%2:
	print('IMPOSSIBLE')
else:
	int k=(a+b)/2
	print(k)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a%2 != b%2:
  	print('IMPOSSIBLE')
else:
	k=(a+b)/2
  	print(k)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a%2 != b%2 :
  	print('IMPOSSIBLE')
else:
	k=(a+b)/2
  	print(k)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a%2 != b%2 :
  	print('IMPOSSIBLE')
else
	k=(a+b)/2
  	print(k)
Problem p02969 (python)

Fixed submission:
r=int(input())
print(3*r**2)

Buggy submission (verdict: Runtime Error):
import math
n,d=map(int,input().split())
print(math.ceil(n/(2*d+1)))
Problem p02612 (python)

Fixed submission:
def main():
    N = int(input())
    if N < 1000:
        print(1000 - N)
        return
    N = str(N)
    N = N[-3] + N[-2] + N[-1]
    N = int(N)
    if N == 0:
        print(0)
        return
    
    print(1000 - N)
    
main()

Buggy submission (verdict: Runtime Error):
def main():
    N = str(input())
    N = N[-3]
    N = int(N)
    N = 10 - N
    if N == 10:
        print(0)
    else:
        print(N*100)
main()
Problem p02639 (python)

Fixed submission:
def main():
    l = list(map(int, input().split()))
    for i in range(len(l)):
        if l[i] == 0:
            print(i + 1)
            return
    
main()

Buggy submission (verdict: Runtime Error):
def main():
    sum, leg = map(int, input().split())
    


    for i in range(sum):
        for x in range(sum - i):
            crane = i * 2
            turtle = x * 4
            total = crane + turtle
            if total == leg:
                print('Yes')
                return
    print('No')
    
main()
Problem p02641 (python)

Fixed submission:
def main():
    import copy

    num, quantity = map(int, input().split())
    nums = list(map(int, input().split()))
    nums.sort()
    
    if quantity == 0:
        print(num)
        return
    
    i = 0

    minus_num = copy.copy(num)
    plus_num = copy.copy(num)

    while i < len(nums):
        if num not in nums:
            print(num)
            return
        
        if minus_num not in nums:
            print(minus_num)
            return
        
        if plus_num not in nums:
            print(plus_num)
            return
        
        minus_num = minus_num - 1
        plus_num = plus_num + 1

main()

Buggy submission (verdict: Runtime Error):
def main():
    import copy

    num, quantity = map(int, input().split())
    nums = list(map(int, input().split()))
    nums.sort()
    
    if quantity == 0:
        print(num)
        return
    
    i = 0

    minus_num = copy.copy(num)
    plus_num = copy.copy(num)

    while i < len(nums)
        if num not in nums:
            print(num)
            return
        
        if minus_num not in nums:
            print(minus_num)
            return
        
        if plus_num not in nums:
            print(plus_num)
            return
        
        minus_num = minus_num - 1
        plus_num = plus_num + 1
        i = i + 1

main()

Buggy submission (verdict: Runtime Error):
def main():
    import copy

    num, quantity = map(int, input().split())
    nums = list(map(int, input().split()))
    nums.sort()
    
    if quantity == 0:
        print(num)
        return
    
    i = 0

    minus_num = copy.copy(num)
    plus_num = copy.copy(num)

    while i = 1
        if num not in nums:
            print(num)
            return
        
        if minus_num not in nums:
            print(minus_num)
            return
        
        if plus_num not in nums:
            print(plus_num)
            return
        
        minus_num = minus_num - 1
        plus_num = plus_num + 1



main()
Problem p02646 (python)

Fixed submission:
import copy

def main():
    A, V = map(int, input().split())
    B, W = map(int, input().split())
    T = int(input())

    if V <= W:
        print('NO')
    elif (abs(A-B) / (V-W)) <= T:
        print('YES')
    else:
        print('NO')

main()

Buggy submission (verdict: Runtime Error):
import copy

def main():
    A, V = map(int, input().split())
    B, W = map(int, input().split())
    T = int(input())

    if V <= W:
        print('NO')
    elif (abs(A-B) / (V-W)) <= t:
        print('YES')
    else:
        print('NO')

main()
Problem p02706 (python)

Fixed submission:
def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split(' ')))
    homework_day = 0
    for i in range(len(A)):
        homework_day = homework_day + A[i]
    if homework_day > N:
        print(-1)
    else:
        print(N - homework_day)
main()

Buggy submission (verdict: Runtime Error):
def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split(' ')))
    homework_day = 0
    for i in range(2):
        homework_day = homework_day + A[i]
    if homework_day > N:
        print(-1)
    else:
        print(N - homework_day)
main()
Problem p02760 (python)

Fixed submission:
def main():
    top = list(map(int, input().split()))
    middle = list(map(int, input().split()))
    bottom = list(map(int, input().split()))
    N = int(input())
    taken = []
    for f in range(N):
        taken.append(int(input()))
    
    bingo = []
    bingo.append(top)
    bingo.append(middle)
    bingo.append(bottom)
    temp = [top[0], middle[0], bottom[0]]
    bingo.append(temp)
    temp = [top[1], middle[1], bottom[1]]
    bingo.append(temp)
    temp = [top[2], middle[2], bottom[2]]
    bingo.append(temp)
    temp = [top[0], middle[1], bottom[2]]
    bingo.append(temp)
    temp = [top[2], middle[1], bottom[0]]
    bingo.append(temp)
    
    if bingo[0][0] in taken and bingo[0][1] in taken and bingo[0][2] in taken:
        print('Yes')
    elif bingo[1][0] in taken and bingo[1][1] in taken and bingo[1][2] in taken:
        print('Yes')
    elif bingo[2][0] in taken and bingo[2][1] in taken and bingo[2][2] in taken:
        print('Yes')
    elif bingo[3][0] in taken and bingo[3][1] in taken and bingo[3][2] in taken:
        print('Yes')
    elif bingo[4][0] in taken and bingo[4][1] in taken and bingo[4][2] in taken:
        print('Yes')
    elif bingo[5][0] in taken and bingo[5][1] in taken and bingo[5][2] in taken:
        print('Yes')
    elif bingo[6][0] in taken and bingo[6][1] in taken and bingo[6][2] in taken:
        print('Yes')
    elif bingo[7][0] in taken and bingo[7][1] in taken and bingo[7][2] in taken:
        print('Yes')
    else:
        print('No')
main()

Buggy submission (verdict: Runtime Error):
def main():
    top = list(map(int, input().split()))
    middle = list(map(int, input().split()))
    bottom = list(map(int, input().split()))
    N = int(input())
    taken = []
    for i in range(N):
        taken.append(int(input()))
    
    bingo = []
    bingo.append(top)
    bingo.append(middle)
    bingo.append(bottom)
    temp = [top[0], middle[0], bottom[0]]
    bingo.append(temp)
    temp = [top[1], middle[1], bottom[1]]
    bingo.append(temp)
    temp = [top[2], middle[2], bottom[2]]
    bingo.append(temp)
    temp = [top[0], middle[1], bottom[2]]
    bingo.append(temp)
    temp = [top[2], middle[1], bottom[0]]
    bingo.append(0)
 
 
    cnt = 0
    flag = 0
    for i in range(len(bingo)):
        cnt = 0
        for j in range(len(bingo[i])):
            if bingo[i][j] in taken:
                cnt += 1
        if cnt == 3:
            flag += 1
    
    if flag > 0:
        print('Yes')
    else:
        print('No')
main()
Problem p03106 (python)

Fixed submission:
def main():
    A, B, K = map(int, input().split())
    count = 0

    for i in range(100, 0, -1):
        if (A % i == 0) and (B % i == 0):
            count += 1
            if count == K:
                print(i)
                break
main()

Buggy submission (verdict: Runtime Error):
def main():
    A, B, K = map(int, input().split())
    higher = 0
    if A < B:
        smaller = A
    else:
        smaller = B
    l = []
    for i in range(smaller):
        if i == 0:
            continue
        if A % i == 0 and B % i == 0:
            l.append(i)
    if (A and B) == 1:
        print(1)
        return
    elif len(l) == 0:
        print(0)
        return
    print(l[(-1*K)])
main()

Buggy submission (verdict: Runtime Error):
def main():
    A, B, K = map(int, input().split())
    higher = 0
    if A < B:
        higher = B
    else:
        higher = A
    l = []
    for i in range(higher):
        if i == 0:
            continue
        if A % i == 0 and B % i == 0:
            l.append(i)
    if len(l) == 0:
        print(1)
        return
    print(l[(-1*K)])
main()
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
ans = (a*b)%2
if ans == 0:
    print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
ans = a*b
 
if (ans/2 === 0):
    print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
ans = (a*b)/2

if (ans === 0):
    print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if ((a*b)/2 === 0):
    print('Even')
else:
    print('Odd')