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

Fixed submission:
import math
import random
from operator import itemgetter
import re
import sys
from itertools import accumulate
from collections import defaultdict
from collections import deque
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
X,Y = map(int,input().split())
if X+Y == 2:
    print(1000000)
elif X+Y == 3:
    print(500000)
elif X+Y == 4:
    print(400000)
elif X == 3 or Y == 3:
    if X == 2 or Y == 2:
        print(300000)
    elif X == 3 and Y == 3:
        print(200000)
    else:
        print(100000)
elif X == 2 or Y ==2:
    print(200000)
elif X == 1 or Y == 1:
    print(300000)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
import math
import random
from operator import itemgetter
import re
import sys
from itertools import accumulate
from collections import defaultdict
from collections import deque
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
X,Y = map(int,input().split())
if X+Y == 2:
    print(1000000)
elif X+Y == 3:
    print(500000)
elif X+Y == 4:
    print(400000)
elif X == 3 or Y == 3:
  	if X == 2 or Y == 2:
    	print(300000)
    elif X == 3 and Y == 3:
      	print(200000)
    else:
    	print(100000)
elif X == 2 or Y ==2:
    print(200000)
elif X == 1 or Y == 1:
    print(300000)
else:
    print(0)
Problem p02882 (python)

Fixed submission:
import math
import random
from operator import itemgetter
import re
import sys
from itertools import accumulate
from collections import defaultdict
from collections import deque
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
input = sys.stdin.readline
a,b,x= map(float,input().split())
if x == a*a*b:
    print(0)
else:
    if x > a*a*b/2:
        left = (x-a*a*b/2)/a
        tei = left*2/a
        left1 = b-tei
        ans = math.atan(a/left1)
        print(90-math.degrees(ans))
    else:
        left = x/a
        tei = left*2/b
        ans = math.atan(b/tei)
        print(math.degrees(ans))

Buggy submission (verdict: Runtime Error):
import math
import random
from operator import itemgetter
import re
import sys
from itertools import accumulate
from collections import defaultdict
from collections import deque
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
input = sys.stdin.readline
a,b,x= map(float,input().split())
if x > a*a*b/2:
    left = (x-a*a*b/2)/a
    tei = left*2/a
    left1 = b-tei
    ans = math.atan(a/left1)
    print(90-math.degrees(ans))
else:
    left = x/a
    tei = left*2/b
    ans = math.atan(b/tei)
    print(math.degrees(ans))
Problem p02883 (python)

Fixed submission:
import math
import random
from operator import itemgetter
import re
import sys
from itertools import accumulate
from collections import defaultdict
from collections import deque
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
input = sys.stdin.readline
N,K = map(int,input().split())
A = [int(i) for i in input().split()]
F = [int(i) for i in input().split()]
A.sort()
F.sort(reverse=True)
maxi = 0
for i in range(N):
    maxi = max(maxi,A[i]*F[i])
start=0
end = maxi
while True:
    count = 0
    value = (start+end)//2
    for i in range(N):
        count += max(0,A[i]-value//F[i])
    if count > K :
        if 2 > end-start:
            value +=1
            break
        start = value
    else:
        if 2 > end-start:
            break
        end = value
print(value)

Buggy submission (verdict: Runtime Error):
import math
import random
from operator import itemgetter
import re
import sys
from itertools import accumulate
from collections import defaultdict
from collections import deque
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
input = sys.stdin.readline
N,K = map(int,input().split())
A.sort()
F.sort(reverse=True)
print(A)
print(F)
maxi = 0
for i in range(N):
    maxi = max(maxi,A[i]*F[i])
start=0
end = maxi
while True:
    count = 0
    value = (start+end)//2
    for i in range(N):
        count += max(0,A[i]-value//F[i])
    if count == K:
        break
    elif count > K :
        if 2 > end-start:
            value +=1
            break
        start = value
    else:
        if 2 > end-start:
            break
        end = value
print(value)
Problem p02995 (python)

Fixed submission:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
A,B,C,D= map(int, input().split())
AC = (A-1)//C
AD = (A-1)//D
ACD =(A-1)//(C*D//gcd(C,D))
ans1 = A -1-AC -AD + ACD
BC = B//C
BD = B//D
BCD = B//(C*D//gcd(C,D))
ans2 = B - BC - BD +BCD
print(ans2-ans1)

Buggy submission (verdict: Runtime Error):
from collections import Counter
import math
A,B,C,D= map(int, input().split())
AC = (A-1)//C
AD = (A-1)//D
ACD =(A-1)//(C*D//math.gcd(C,D))
ans1 = A -1-AC -AD + ACD
BC = B//C
BD = B//D
BCD = B//(C*D//math.gcd(C,D))
ans2 = B - BC - BD +BCD
print(ans2-ans1)
Problem p02996 (python)

Fixed submission:
from collections import Counter
from operator import itemgetter
import math
N = int(input())
work_list = [[int(i) for i in input().split()] for i in range(N)]
new_worklist=sorted(work_list, key=itemgetter(1))
now_time = 0
for i in range (N):
	now_time += new_worklist[i][0]
	if now_time > new_worklist[i][1]:
		print("No")
		break
	if i == N-1:
		print("Yes")

Buggy submission (verdict: Runtime Error):
num1 = 2
num2 = 3
chk = 0
N,K =map(int,input().split())
if K > (N-1)*(N-2)//2:
	print(-1)
else:
	for i in range(2,N+1):
		print("1"+" "+str(i))
	left = (N-1)*(N-2)//2 - K
	for i in range(left):
			if N >= num2 :
				if chk == 1:
					num2 += 1
					chk = 0
				print(str(num1) + " " + str(num2))
				num2 += 1
			else:
				num1 +=1
				num2 = num1+1
				print(str(num1) + " " + str(num2))
				chk = 1
Problem p03006 (python)

Fixed submission:
import math
N = int(input())
s_dict = {}
cood_list=[]
ans = 0
for i in range(N):
    a,b = map(int,input().split())
    for j in range(len(cood_list)):
        p = a - cood_list[j][0]
        q = b - cood_list[j][1]
        if 0 > p:
            p = -p
            q = -q
        elif p == 0:
            q = abs(q)
        s = str(p)+","+str(q)
        if s not in s_dict:
            s_dict[s] = 1
        else:
            s_dict[s] += 1
    cood = [a,b]
    cood_list.append(cood)
if N != 1:
    print(N-max(s_dict.values()))
else:
    print(1)

Buggy submission (verdict: Runtime Error):
N = int(input())
s_dict = {}
cood_list=[]
ans = 0
for i in range(N):
    a,b = map(int,input().split())
    for j in range(len(cood_list)):
        p = a - cood_list[j][0]
        q = b - cood_list[j][1]
        s = str(p)+","+str(q)
        if s not in s_dict:
            s_dict[s] = 1
        else:
            s_dict[s] += 1
    cood = [a,b]
    cood_list.append(cood)
print(N-max(s_dict.values()))

Buggy submission (verdict: Runtime Error):
from collections import Counter
import math
N = int(input())
x,y = map(int, input().split())
dis_list = [[x,y]]
for i in range(N-1):
	x , y = map(int,input().split())
	for j in range(len(dis_list)):
		x = abs(x- dis_list[j][0])
		y = abs(y-dis_list[j][1])
		dis_list.append([x,y])
dis_list = dis_list[1:1+N*(N-1)//2]
counter = Counter(map(tuple, dis_list))
print(N-counter.most_common()[0][1])
Problem p03049 (python)

Fixed submission:
N = int(input())
a_count =0
b_count =0
ab_count =0
ab_alt =0
flag =0
for i in range(N):
    test = str(input())
    if test[0] == "B":
        b_count +=1
        flag =1
    if test[-1] == "A":
        a_count += 1
        if flag == 1:
            flag =0
            ab_alt +=1
    ab_count += test.count("AB")
if ab_alt != 0:
    if ab_alt == b_count:
        if ab_alt == a_count:
            a_count += -1
print(ab_count+min(a_count,b_count))

Buggy submission (verdict: Runtime Error):
N = int(input())
a_count =0
b_count =0
ab_count =0
ab_alt =0
for i in range(N):
    test = str(input())
    if test[0] == "B":
        b_count +=1
        flag =1
    if test[-1] == "A":
        a_count += 1
        if flag == 1:
            flag =0
            ab_alt +=1
    ab_count += test.count("AB")
if ab_alt == b_count:
    if ab_alt == a_count:
        a_count += -1
print(ab_count+min(a_count,b_count))
Problem p03061 (python)

Fixed submission:
import fractions
N = int(input())
A = [int(i) for i in input().split()]
gcd_left = [0] * N
gcd_right = [0] * N
chk = 1
for i in range(N):
	if i == 0:
		chk = A[0]
	else:
		chk = fractions.gcd(chk,A[i])
	gcd_left[i] = chk
temp = 0
for i in range(N):
	num = N-1-i
	if i == 0 :
		temp = A[num]
	else:
		temp = fractions.gcd(temp,A[num])
	gcd_right[num] = temp
ans = 0
for i in range(N):
	if i == 0:
		ans = max(ans,gcd_right[1])
	elif i == N-1:
		ans = max(ans,gcd_left[N-2])
	else:
		ans = max(ans,fractions.gcd(gcd_left[i-1],gcd_right[i+1]))
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
gcd_left = [0] * N
gcd_right = [0] * N
chk = 1
for i in range(N):
	if i == 0:
		chk = A[0]
	else:
		chk = fractions.gcd(chk,A[i])
	gcd_left[i] = chk
temp = 0
for i in range(N):
	num = N-1-i
	if i == 0 :
		temp = A[num]
	else:
		temp = fractions.gcd(temp,A[num])
	gcd_right[num] = temp
ans = 0
for i in range(N):
	if i == 0:
		ans = max(ans,gcd_right[1])
	elif i == N-1:
		ans = max(ans,gcd_left[N-2])
	else:
		ans = max(ans,fractions.gcd(gcd_left[i-1],gcd_right[i+1]))
print(ans)
Problem p03068 (python)

Fixed submission:
N = int(input())
S = input()
K = int(input())
M = str()
for i in range(N):
    if S[i] != S[K-1]:
        M= M +"*"
    else:
        M= M +S[i]
print(M)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
K = int(input())
M = str()
for i in range(N):
    if S[i] != S[K]:
        M= M +"*"
    else:
        M= M +S[i]
print(M)
Problem p03074 (python)

Fixed submission:
import math
N,K = map(int,input().split())
S = input()
seq = 1
v_seq = 1
down_list = []
count = 0
down_num = 0
ans = 0
chk = 0
for i in range(N-1):
    if S[i] == S[i+1]:
        seq += 1
        v_seq += 1
    elif S[i] == "0":
        down_list.append(seq)
        seq = 1
        v_seq += 1
        count += 1
        if count == K:
            chk = 1
    else:
        if chk == 2:
            v_ans = v_ans + v_seq-down_list[v_count]
            v_count += 1
            ans = max(ans,v_ans)
        v_seq = 1
        seq += 1
        if chk == 1:
            ans = i+1
            v_ans = i+1
            v_count = 0
            chk = 2
if ans == 0:
    print(N)
else:
    v_ans = v_ans + v_seq-down_list[v_count]
    print(max(ans,v_ans))

Buggy submission (verdict: Runtime Error):
N,K=input().split()
N = int(N)
K = int(K)
S = input()
ini = 0
i = 0
while S[i] == "0":
    ini = ini+1
    i += 1
S = int(S)
len_list=[]
one_count = 0
zero_count = 0
def ten_am(a):
    global zero_count
    global one_count
    x = a//10
    y = a%10
    if y == 0:
        zero_count +=1
        if one_count != 0:
            len_list.append(one_count)
        one_count=0
    else:
        one_count +=1
        if zero_count != 0:
            len_list.append(zero_count)
        zero_count =0
    if x != 0:
        ten_am(x)
    else:
        len_list.append(max([one_count,zero_count]))
    return len_list
len_list = ten_am(S)
if ini !=0:
    len_list.append(ini)
si = len(len_list)
ans = sum(len_list[0:2*K])
if K+1 > si :
    print (sum(len_list))
else:
    for i in range(si-2*K):
        s = sum(len_list[i+1:i+2*K+2])
        if s > ans:
            ans = s
    print(ans)
Problem p03085 (python)

Fixed submission:
s = input()
p = s.replace('A','B')
q = p.replace('T','A')
r = q.replace('B','T')
w = r.replace('G','W')
x = w.replace('C','G')
y = x.replace('W','C')
print(y)

Buggy submission (verdict: Runtime Error):
s = input()
p = s.replace('A','B')
q = p.replace('T','A')
r = q.replace('B','T')
w = r.replace('G','W')
x = w.replace('C','G')
y = x.replace('W','C')
print(y)
~

Buggy submission (verdict: Runtime Error):
n,q = map(int,input().split())
s = input()
m = [list(map(int,input().split())) for i in range(q)]
count = [0]*(N+1)
 
for i in range(n):
    if S[i:i+2] == 'AC':
        comu[i+1] = comu[i] + 1
    else:
        comu[i+1] = comu[i]
 
for l,r in list:
    print(count[r-1]-count[l-1])

Buggy submission (verdict: Runtime Error):
n,q = map(int(input().split()))
s = input()
m = list(map(int,input().split for i in range(q)))
count = [0]*(N+1)

for i in range(n):
    if S[i:i+2] == 'AC':
        comu[i+1] = comu[i] + 1
    else:
        comu[i+1] = comu[i]

for l,r in list:
    print(count[r-1]-count[l-1])
~

Buggy submission (verdict: Runtime Error):
n,q = map(int(input().split()))
s = input()
m = list(map(int,input().split for i in range(q)))
count = [0]*(N+1)

for i in range(N):
    if S[i:i+2] == 'AC':
        comu[i+1] = comu[i] + 1
    else:
        comu[i+1] = comu[i]

for l,r in list:
    print(count[r-1]-count[l-1])
Problem p03087 (python)

Fixed submission:
n,q = map(int,input().split())
s = input()
m = [list(map(int,input().split())) for i in range(q)]
count = [0]*(n+1)
 
for i in range(n):
    if s[i:i+2] == 'AC':
        count[i+1] = count[i] + 1
    else:
        count[i+1] = count[i]
 
for l,r in m:
    print(count[r-1]-count[l-1])

Buggy submission (verdict: Runtime Error):
n,q = map(int,input().split())
s = input()
m = [list(map(int,input().split())) for i in range(q)]
count = [0]*(n+1)
 
for i in range(n):
    if s[i:i+2] == 'AC':
        count[i+1] = count[i] + 1
    else:
        count[i+1] = count[i]
 
for l,r in m:
    print(count[r-1]-count[l-1]

Buggy submission (verdict: Runtime Error):
n,q = map(int,input().split())
s = input()
m = [list(map(int,input().split())) for i in range(q)]
count = [0]*(n+1)
 
for i in range(n):
    if S[i:i+2] == 'AC':
        count[i+1] = count[i] + 1
    else:
        count[i+1] = count[i]
 
for l,r in m:
    print(count[r-1]-count[l-1]

Buggy submission (verdict: Runtime Error):
n,q = map(int,input().split())
s = input()
m = [list(map(int,input().split())) for i in range(q)]
count = [0]*(n+1)
 
for i in range(n):
    if S[i:i+2] == 'AC':
        comu[i+1] = comu[i] + 1
    else:
        comu[i+1] = comu[i]
 
for l,r in m:
    print(count[r-1]-count[l-1]

Buggy submission (verdict: Runtime Error):
n,q = map(int,input().split())
s = input()
m = [list(map(int,input().split())) for i in range(q)]
count = [0]*(N+1)
 
for i in range(n):
    if S[i:i+2] == 'AC':
        comu[i+1] = comu[i] + 1
    else:
        comu[i+1] = comu[i]
 
for l,r in m:
    print(count[r-1]-count[l-1])

Buggy submission (verdict: Runtime Error):
n,q = map(int,input().split())
s = input()
m = [list(map(int,input().split())) for i in range(q)]
count = [0]*(N+1)
 
for i in range(n):
    if S[i:i+2] == 'AC':
        comu[i+1] = comu[i] + 1
    else:
        comu[i+1] = comu[i]
 
for l,r in list:
    print(count[r-1]-count[l-1])

Buggy submission (verdict: Runtime Error):
n,q = map(int,input().split())
s = input()
m = list(map(int,input().split for i in range(q)))
count = [0]*(N+1)

for i in range(n):
    if S[i:i+2] == 'AC':
        comu[i+1] = comu[i] + 1
    else:
        comu[i+1] = comu[i]

for l,r in list:
    print(count[r-1]-count[l-1])
~

Buggy submission (verdict: Runtime Error):
n,q = map(int,(input().split()))
s = input()
m = list(map(int,input().split for i in range(q)))
count = [0]*(N+1)

for i in range(n):
    if S[i:i+2] == 'AC':
        comu[i+1] = comu[i] + 1
    else:
        comu[i+1] = comu[i]

for l,r in list:
    print(count[r-1]-count[l-1])
~

Buggy submission (verdict: Runtime Error):
n,q = map(int(input().split()))
s = input()
m = list(map(int,input().split for i in range(q)))
count = [0]*(N+1)

for i in range(n):
    if S[i:i+2] == 'AC':
        comu[i+1] = comu[i] + 1
    else:
        comu[i+1] = comu[i]

for l,r in list:
    print(count[r-1]-count[l-1])
~
Problem p03419 (python)

Fixed submission:
import math
from operator import itemgetter
import re
import sys
from itertools import accumulate
from collections import defaultdict
from collections import deque
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
input = sys.stdin.readline
N,M = map(int,input().split())
if N > 1 and M > 1:
    print((N-2)*(M-2))
elif N==1 and M == 1:
    print(1)
else:
    print(N+M-3)

Buggy submission (verdict: Runtime Error):
import math
from operator import itemgetter
import re
import sys
from itertools import accumulate
from collections import defaultdict
from collections import deque
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
input = sys.stdin.readline
N,M = map(int,input().split())
if N > 1 and M > 1:
    print((N-2)*(M-2))
elif N==1 and M == 1:
    print(1)
else:
    print(N+M-3))
Problem p03473 (python)

Fixed submission:
k = list(map(int,input().split()))
print(48-k[0])

Buggy submission (verdict: Runtime Error):
print(48-input())
Problem p03485 (python)

Fixed submission:
k = list(map(int,input().split()))
print(-(-(k[0]+k[1])//2))

Buggy submission (verdict: Runtime Error):
k = list(map(int,input().split()))
print(-(-(k[0]+k[1])//2)

Buggy submission (verdict: Runtime Error):
k = list(map(int,input().splitlines()))

print(-(-(k[0]+k[1])//2)
Problem p03493 (python)

Fixed submission:
n = int(input())
if n%3 == 0:
    if n == 111:
        print(3)
    else:
        print (0)
elif n%3 ==1:
    print(1)
else:
    print(2)

Buggy submission (verdict: Runtime Error):
import sys
import os
f = open("C:/Users/user/Documents/python/ant/import.txt","r")
sys.stdin = f

# -*- coding: utf-8 -*-

n = int(input())
if n%3 == 0:
    if n == 111:
        print 3
    else
        print 0
elif n%3 ==1:
    print 1
else
    print 2

Buggy submission (verdict: Runtime Error):
n = int(input())
if n%3 == 0:
    if n == 111:
        print 3
    else
        print 0
elif n%3 ==1:
    print 1
else
    print 2
Problem p03583 (python)

Fixed submission:
N=int(input())
for i in range(1,3501):
  for j in range(i,3501):
    if (4*i*j-N*(i+j))>0 and N*i*j%(4*i*j-N*(i+j))==0:
      k=N*i*j//(4*i*j-N*(i+j))
      print(i,j,k)
      break
  else:
    continue
  break

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
onlyb = 0
onlyw = 0
twotn = 0
flag = 0
ch =0
for i in range(N):
    if S[i] == ".":
        onlyb += 1
        ch = 0
        if flag != 0:
            twotn +=1
    else:
        onlyw += 1
        ch +=1
        flag = 1

print(min(onlyb,onlyw-ch,twotn))
Problem p03588 (python)

Fixed submission:
N = int(input())
e = [[int(i) for i in input().split()] for i in range(N)]
mar=e[0][0]
mmv=e[0][1]
for i in range(N):
    if e[i][0] > mar:
        mar =e[i][0]
        mmv=e[i][1]
print(mar+mmv)

Buggy submission (verdict: Runtime Error):
N = int(input())
e = [[int(i) for i in input().split()] for i in range(N)]
mar=e[0][0]
mir=e[0][0]
mav=0
miv=0
mv=0
mmv=e[i][1]
for i in range(N):
    if e[i][0] > mar:
        mar =e[i][0]
        mmv=e[i][1]
print(mar+mmv)
Problem p03614 (python)

Fixed submission:
N=int(input())
p = list(int(i) for i in input().split())
count = 0
for i in range(N):
    if p[i] == i+1:
        if i != N-1:
            a = p[i]
            p[i] = p[i+1]
            p[i+1] = a
            count += 1
        else:
            count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N=int(input())
p = list(int(i) for i in input().split())
count = 0
for i in range(N):
    if p[i] == i+1:
        a = p[i]
        p[i] = p[i+1]
        p[i+1] = a
        count += 1
print(count)
Problem p03862 (python)

Fixed submission:
N,x = map(int,input().split())
a = [int(i) for i in input().split()]
ans = 0
if a[0] > x:
  ans += (a[0]-x)
  a[0] = x
for i in range(N-1):
  if a[i] + a[i+1] > x:
    ans += (a[i]+a[i+1]-x)
    a[i+1] -= (a[i]+a[i+1]-x)
print(ans)

Buggy submission (verdict: Runtime Error):
N,x = map(int,input().split())
a = [int(i) for i in input.split()]
ans = 0
if a[0] > x:
  ans += (a[0]-x)
  a[0] = x
for i in range(N-1):
  if a[i] + a[i+1] > x:
    ans += (a[i]+a[i+1]-x)
    a[i+1] -= (a[i]+a[i+1]-x)
print(ans)
Problem p03951 (python)

Fixed submission:
N = input()
N =int(N)
s = input()
t = input()
y = 0
for i in range(N):
    q = s[-(i+1):]
    r = t[:i+1]
    if q == r :
        x = q
        y =i+1
print(N*2-y)

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

for i in range(N):
    q = s[-(i+1):]
    r = t[:i+1]
    if q == r :
        x = q
        y =i+1
print(N*2-y)

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

for i in range(N):
    q = s[-(i+1):]
    r = t[:i+1]
    if q == r :
        x = q
        y =i+1
print(s[:N-y]+t)
Problem p03962 (python)

Fixed submission:
A,B,C = map(int,input().split())
ans =1
if A != B:
  ans += 1
if A != C and B != C:
  ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
ans =1
if A != B:
  ans += 1
if A != C and B != C:
  ans += 1
print(ANS)
Problem p03998 (python)

Fixed submission:
a = input()
b = input()
c = input()
def turn(x ,a_hand ,b_hand ,c_hand):
    if not a_hand and x == "a":
        print("A")
        return
    if not b_hand and x =="b":
        print("B")
        return
    if not c_hand and x =="c":
        print("C")
        return
    if x == "a":
        x = a_hand[0]
        a_hand = a_hand[1:]
        turn(x , a_hand , b_hand , c_hand)
    elif x == "b":
        x = b_hand[0]
        b_hand = b_hand[1:]
        turn(x , a_hand , b_hand , c_hand)
    else:
        x = c_hand[0]
        c_hand = c_hand[1:]
        turn(x , a_hand , b_hand , c_hand)
turn("a",a,b,c)

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
c = input()
def turn(x ,a_hand ,b_hand ,c_hand):
    if not a_hand and x == "a"
        print("A")
        return
    if not b_hand and x =="b":
        print("B")
        return
    if not c_hand and x =="c":
        print("C")
        return
    if x == "a":
        x = a_hand[0]
        a_hand = a_hand[1:]
        turn(x , a_hand , b_hand , c_hand)
    elif x == "b":
        x = b_hand[0]
        b_hand = b_hand[1:]
        turn(x , a_hand , b_hand , c_hand)
    else:
        x = c_hand[0]
        c_hand = c_hand[1:]
        turn(x , a_hand , b_hand , c_hand)
Problem p04043 (python)

Fixed submission:
A,B,C = map(int,input().split())
if A*B*C == 175:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
A,B,C = int(input())
if A*B*C == 175:
  print("YES")
else:
  print("NO")
Problem p02658 (python)

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

ans = 1
if 0 in a:
  print(0)
  quit()
  
for i in range(n):
  ans *= a[i]
  if ans > 1e18:
    ans = -1
    break

print(ans)

Buggy submission (verdict: Runtime Error):
import sys
n = int(input())
A = list(map(int, input().split()))

ans = 1
if 0 in A:
  print(0)
  sys.quit()
  
for i in range(n):
  ans *= A[i]
  if ans > 1e18:
    ans = -1
    break

print(ans)
Problem p02696 (python)

Fixed submission:
a,b,n = map(int, input().split())

x =  min(b-1, n)
print(int(a*x/b) - a*int(x/b))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**7)
a,b,n = map(int, input().split())

def num(x):
    return (a*x)//b - a*(x//b)

ma = num(1)

for i in range(2, n+1):
    if num(i) > ma:
        ma = num(i)
    else:
        if num(i) >= num(i-1):
        print(ma)
        exit()
print(ma)