Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=list(map(int,input().split())
if sum(b)>2*max(b):
       print("Yes")
else:
       print("No")

Fixed submission:
a=int(input())
b=list(map(int,input().split()))
if sum(b)>2*max(b):
       print("Yes")
else:
       print("No")
Buggy python submission (verdict: Runtime Error):
k=int(input())
if k=25:
  print("Christmas")


Fixed submission:
k=int(input())
if k==25:
  print("Christmas")
if k==24:
  print("Christmas Eve")
if k==23:
  print("Christmas Eve Eve")
if k==22:
  print("Christmas Eve Eve Eve")

Buggy python submission (verdict: Runtime Error):
k=int(input())
if k=25:
  print("Christmas")
if k=24:
  print("Christmas Eve")
if k=23:
  print("Christmas Eve Eve")
if k=22:
  print("Christmas Eve Eve Eve")

Fixed submission:
k=int(input())
if k==25:
  print("Christmas")
if k==24:
  print("Christmas Eve")
if k==23:
  print("Christmas Eve Eve")
if k==22:
  print("Christmas Eve Eve Eve")
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input())
b=sum(a)-max(a)/2
print(b)

Fixed submission:
n=int(input())
a=[int(input()) for i in range(n)]
b=sum(a)-max(a)/2
print(int(b))
Buggy python submission (verdict: Runtime Error):
a=int(input())
if a==1:
  print("Hello World")
b=int(input())
c=int(input())

if a==2:
  print(int(b+c))

Fixed submission:
a=int(input())
if a==1:
  print("Hello World")
else:
  b=int(input())
  c=int(input())
  print(int(b+c))

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
if a==1:
  print("Hello World")
if a==2:
  print(int(b+c))

Fixed submission:
a=int(input())
if a==1:
  print("Hello World")
else:
  b=int(input())
  c=int(input())
  print(int(b+c))

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
if a==1:
  print("Hello World")
else:
  print(int(b+c))
  

Fixed submission:
a=int(input())
if a==1:
  print("Hello World")
else:
  b=int(input())
  c=int(input())
  print(int(b+c))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split)
if(a%2==1 and b%2==1):
  print("Yes")
else:
  print("No")

Fixed submission:
a,b=map(int,input().split())
if(a%2==1 and b%2==1):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
e=c-a
f=d-b
g=c-f
h=d+e
i=g-e
j=h-f
print(g)
print(h)
print(i)
print(j)

Fixed submission:
n=int(input())
if(n%2==0):
  k=(n/2)*(n/2)
else:
  k=int(n/2)*(int(n/2)+1)
print(int(k))
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
e=c-a
f=d-b
g=c-f
h=d+e
i=g-e
j=h-f
print(g h i j)

Fixed submission:
a,b,c,d=map(int,input().split())
e=c-a
f=d-b
g=c-f
h=d+e
i=g-e
j=h-f
print(g)
print(h)
print(i)
print(j)

Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
e=c-a
f=d-b
g=c-f
h=d+e
i=g-e
j=h-f
print(list[g,h,i,j])

Fixed submission:
a,b,c,d=map(int,input().split())
e=c-a
f=d-b
g=c-f
h=d+e
i=g-e
j=h-f
print(g)
print(h)
print(i)
print(j)

Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
e=c-a
f=d-b
g=c-f
h=d+e
i=g-e
j=h-f
print(list[g,h,i,j])

Fixed submission:
a,b,c,d=map(int,input().split())
e=c-a
f=d-b
g=c-f
h=d+e
i=g-e
j=h-f
print(g)
print(h)
print(i)
print(j)

Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
e=c-a
f=d-b
g=c-f
h=d+e
i=g-e
j=h-f
print(int(g) int(h) int(i) int(j))

Fixed submission:
a,b,c,d=map(int,input().split())
e=c-a
f=d-b
g=c-f
h=d+e
i=g-e
j=h-f
print(g)
print(h)
print(i)
print(j)
Buggy python submission (verdict: Runtime Error):
a = int(input(''))
b = int(input(''))
c = int(input(''))
d = int(input(''))
e = int(input(''))
list_i = [a,b,c,d,e]

list_m = map(lambda x : 10 - x % 10 ,list_i)
list_i = [x + y if x !=10 else y for (x,y) in zip(list_m,list_i)]
list_v = filter(lambda x : x != 10 , list_m)
print sum(list_i) - max(list(list_v))

Fixed submission:
a = int(input(''))
b = int(input(''))
c = int(input(''))
d = int(input(''))
e = int(input(''))
list_i = [a,b,c,d,e]
 
min_n = list_i[0] % 10
v = 0
count = 0
 
for i in range(len(list_i)):
 if list_i[i] % 10 < min_n and list_i[i] % 10 != 0:
  count = i
 
for i in range(len(list_i)):
 if i == count or list_i[i] % 10 == 0:
  v = v + list_i[i]
 else:
  v = v + list_i[i] + ( 10 - list_i[i] % 10)
 
print v
Buggy python submission (verdict: Runtime Error):
for i in range(6):
    a.append(int(input()))

if a[4] - a[0] <= a[5]:
    print('Yay!')
else:
    print(':(')

Fixed submission:
a = []

for i in range(6):
    a.append(int(input()))

if a[4] - a[0] <= a[5]:
    print('Yay!')
else:
    print(':(')
Buggy python submission (verdict: Runtime Error):
def ex2019a():
     # 入力を受け取る
    n = raw_input().split(" ")
    a = int(n[0])
    b = int(n[1])
    c = int(n[2])

    if a == b and b == c:
        print "Yes"
    else:
        print "No"

def main():
    ex2019a()
	
if __name__ == '__main__':
    main()

Fixed submission:
# -*- coding: utf-8 -*-
def ex2019a():
     # 入力を受け取る
    n = raw_input().split(" ")
    a = int(n[0])
    b = int(n[1])
    c = int(n[2])

    if a == b and b == c:
        print "Yes"
    else:
        print "No"

def main():
    ex2019a()
	
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
str = input()

if str = 'A':
  print('T')
else if str ='T':
  print('A')
else if str ='C':
  print('G')
else if str ='G':
  print('C')
else:
  print('error')

Fixed submission:
str = input()

if str == 'A':
  print('T')
elif str =='T':
  print('A')
elif str =='C':
  print('G')
elif str =='G':
  print('C')
else:
  print('error')
Buggy python submission (verdict: Runtime Error):
str = input()
a = int(str[0])
b = int(str[2])*10 + int(str[3])

if (b % a) == 0:
	print(a + b)
else:
	print(b-a)

Fixed submission:
str = input().split()
a = int(str[0])
b = int(str[1])

if (b % a) == 0:
	print(a + b)
else:
	print(b-a)

Buggy python submission (verdict: Runtime Error):
str = input().strip()

a = int(str[1])
b = int(str[2])

if (b % a) == 0:
	print(a + b)
else:
	print(b-a)

Fixed submission:
str = input().split()
a = int(str[0])
b = int(str[1])

if (b % a) == 0:
	print(a + b)
else:
	print(b-a)

Buggy python submission (verdict: Runtime Error):
str = input().strip()

a = int(str[1])
b = int(str[2])

if (b % a) == 0:
	print(a + b)
else:
	print(b-a)

Fixed submission:
str = input().split()
a = int(str[0])
b = int(str[1])

if (b % a) == 0:
	print(a + b)
else:
	print(b-a)
Buggy python submission (verdict: Runtime Error):
    import sys
     
    args = list(map(int, input().split()))
         
    if (args[0] < args[1] and args[1] < args[2]) or (args[2] < args[1] and args[1] < args[0]):
        print("Yes")
    else:
        print("No")

Fixed submission:
import sys
         
args = list(map(int, input().split()))
             
if (args[0] < args[2] and args[2] < args[1]) or (args[1] < args[2] and args[2] < args[0]):
    print("Yes")
else:
    print("No")

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

    if (args[0] < args[1] and args[1] < args[2]) or (args[2] < args[1] and args[1] < args[0]):
        print("yes")
    else:
        print("no")

Fixed submission:
import sys
         
args = list(map(int, input().split()))
             
if (args[0] < args[2] and args[2] < args[1]) or (args[1] < args[2] and args[2] < args[0]):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import sys

args = [int(input()) for i in range(6)]
#args = [29,20,7,35,120]
smallest = 10
i = 0
sum = 0
arg_num = 0

for tmp in args[:4]:
    if tmp % 10 < smallest:
        if tmp % 10 != 0:
            smallest = tmp % 10
            arg_num = i
    i+=1

print("smallest:" + str(arg_num))

for i in range(5):
    if i != arg_num:
        if args[i] % 10 != 0:
            args[i] = args[i] + (10 - args[i] % 10)
    print("args[" + str(i) + "]:" + str(args[i]))
    sum += args[i]

print(sum)


Fixed submission:
import sys

args = [int(input()) for i in range(5)]
#args = [29,20,7,35,120]
smallest = 10
i = 0
sum = 0
arg_num = 0

for tmp in args[:4]:
    if tmp % 10 < smallest:
        if tmp % 10 != 0:
            smallest = tmp % 10
            arg_num = i
    i+=1

#print("smallest:" + str(arg_num))

for i in range(5):
    if i != arg_num:
        if args[i] % 10 != 0:
            args[i] = args[i] + (10 - args[i] % 10)
    #print("args[" + str(i) + "]:" + str(args[i]))
    sum += args[i]

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

arg = input()
scavenger=''
warehouse=[]
longest=0
i=0

for tmp in arg[0:]:
  if tmp=='A' | tmp=='T' | tmp=='C' | tmp=='G':
    scavenger=scavenger+tmp
  else:
    warehouse.append(scavenger)
    scavenger=''

for tmp in warehouse[0:]:
  if len(tmp)>longest:
    longest=len(tmp)

print(longest)

Fixed submission:
import sys

arg = input()
scavenger=''
warehouse=[]
longest=0
i=0

for tmp in arg[0:]:
  if tmp=='A' or tmp=='T' or tmp=='C' or tmp=='G':
    scavenger=scavenger+tmp
  else:
    warehouse.append(scavenger)
    scavenger=''

warehouse.append(scavenger)

for tmp in warehouse[0:]:
  if len(tmp)>longest:
    longest=len(tmp)

print(longest)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
c = []
for i in range(M):
	c.append(list(map(int, input().split())))

for i in range(M):
	if c[i][0] == 1:
		for j in range(M):
			if c[j][0] == c[i][1]:
				if c[j][1] == N:
					print('POSSIBLE')
					exit()

print('IMPOSSIBLE')

Fixed submission:
N, M = map(int, input().split())
c = []
for i in range(M):
	c.append(list(map(int, input().split())))
d = []
e = []


for i in range(M):
	if c[i][0] == 1:
		d.append(c[i][1])

for i in range(M):
	if c[i][1] == N:
		e.append(c[i][0])

l = list(set(d) & set(e))

if l == []:
	print('IMPOSSIBLE')
else:
	print('POSSIBLE')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int, input().split()))

c = []
for i in range(N-1):
	b = a[0:i+1]
	c.append(abs(sum(a)-2*sum(b)))

print(min(c))

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

c = [2*a[0]-sum(a)]
d = [abs(c[0])]
for i in range(N-2):
	c.append(c[i]+2*a[i+1])
	d.append(abs(c[i+1]))

print(min(d))
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())

for h in range(1, H-1)
	A = h * W
	B = int((H - h)//2) * W
	C = H * W - (A + B)
	D = max(A, B ,C) - min(A, B, C)
	a1 = []
	a1.append(D)
	A1 = min(a1)

for h in range(1, H-1)
	A = h * W
	B = int(W//2) * (H - h)
	C = H * W - (A + B)
	D = max(A, B ,C) - min(A, B, C)
	a2 = []
	a2.append(D)
	A2 = min(a2)

H, W = W, H

for h in range(1, H-1)
	A = h * W
	B = int((H - h)//2) * W
	C = H * W - (A + B)
	D = max(A, B ,C) - min(A, B, C)
	a3 = []
	a3.append(D)
	A3 = min(a3)

for h in range(1, H-1)
	A = h * W
	B = int(W//2) * (H - h)
	C = H * W - (A + B)
	D = max(A, B ,C) - min(A, B, C)
	a4 = []
	a4.append(D)
	A4 = min(a4)

print(int(min(A1, A2, A3, A4)))

Fixed submission:
H, W = map(int, input().split())
a1, a2, a3, a4 = [], [], [], []

for h in range(1, H):
	A = h * W
	B = int((H - h)//2) * W
	C = H * W - (A + B)
	D = max(A, B ,C) - min(A, B, C)
	a1.append(D)
A1 = min(a1)

for h in range(1, H):
	A = h * W
	B = int(W//2) * (H - h)
	C = H * W - (A + B)
	D = max(A, B ,C) - min(A, B, C)
	a2.append(D)
A2 = min(a2)

H, W = W, H

for h in range(1, H):
	A = h * W
	B = int((H - h)//2) * W
	C = H * W - (A + B)
	D = max(A, B ,C) - min(A, B, C)
	a3.append(D)
A3 = min(a3)

for h in range(1, H):
	A = h * W
	B = int(W//2) * (H - h)
	C = H * W - (A + B)
	D = max(A, B ,C) - min(A, B, C)
	a4.append(D)
A4 = min(a4)

print(int(min(A1, A2, A3, A4)))
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
c = []
for i in range(N):
	c.append(input().split())
	
c.sort(key=lambda x: x[0])

f = 0
for i in range(N):
	f += int(c[i][1])
	if f >= K:
		print(c[i][0])
		break

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

if C >= A and C <= B:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = input().split()

c = 1
i = 1
while i <= N-2:
	if int(A[i])-int(A[i-1]) > 0:
		if int(A[i+1])-int(A[i]) < 0:
			c += 1
			i += 2
		elif int(A[i+1])-int(A[i]) > 0:
			i += 1
		else:
			while int(A[i])-int(A[i-1]) == 0:
				i += 1
			if int(A[i])-int(A[i-1]) < 0:
				c += 1
				i += 2
	elif int(A[i])-int(A[i-1]) < 0:
		if int(A[i+1])-int(A[i]) > 0:
			c += 1
			i += 2
		else:
			while int(A[i])-int(A[i-1]) == 0:
				i += 1
			if int(A[i])-int(A[i-1]) > 0:
				c += 1
				i += 2
	else:
		i += 1

 
print(c)

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

c = 1
i = 1

while i <= N-1:
	if int(A[i])-int(A[i-1]) == 0:
		del A[i-1]
		N -= 1
	else:
		i += 1

i = 1

while i <= N-2:
	if int(A[i])-int(A[i-1]) > 0:
		if int(A[i+1])-int(A[i]) < 0:
			c += 1
			i += 2
		else:
			i += 1
	else:
		if int(A[i+1])-int(A[i]) > 0:
			c += 1
			i += 2
		else:
			i += 1
 
print(c)
Buggy python submission (verdict: Runtime Error):
l = input().split()
A = l[0]
B = l[1]
T = A + B
if T < 24:
	print(T)
else:
	print(T-24)

Fixed submission:
l = input().split()
A = int(l[0])
B = int(l[1])

T = int(A + B)
if T < 24:
	print(T)
else:
	print(T - 24)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
for i in range(5):
    a.append(int(input()))
nn = [0] * 6
nn[0] = n
count = 0
while nn[5] != n:
    idou_1 = min(a[0],nn[0])
    idou_2 = min(a[1],nn[1])
    idou_3 = min(a[2],nn[2])
    idou_4 = min(a[3],nn[3])
    idou_5 = min(a[4],nn[4])
    nn[0] -= idou_1
    nn[1] += idou_1
    nn[1] -= idou_2
    nn[2] += idou_2
    nn[2] -= idou_3
    nn[3] += idou_3
    nn[3] -= idou_4
    nn[4] += idou_4
    nn[4] -= idou_5
    nn[5] += idou_5
    count += 1
    #if nn[5] == n:
        #break
    #print(nn)
print(count)

Fixed submission:
import math
n = int(input())
a = [int(input()) for i in range(5)]
print(math.ceil(n/min(a[0],a[1],a[2],a[3],a[4]))+4)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
for i in range(5):
    a.append(int(input()))
nn = [0] * 6
nn[0] = n
count = 0
while nn[5] != n:
    idou_1 = min(a[0],nn[0])
    idou_2 = min(a[1],nn[1])
    idou_3 = min(a[2],nn[2])
    idou_4 = min(a[3],nn[3])
    idou_5 = min(a[4],nn[4])
    nn[0] -= idou_1
    nn[1] += idou_1
    nn[1] -= idou_2
    nn[2] += idou_2
    nn[2] -= idou_3
    nn[3] += idou_3
    nn[3] -= idou_4
    nn[4] += idou_4
    nn[4] -= idou_5
    nn[5] += idou_5
    count += 1
    #if nn[5] == n:
        #break
    #print(nn)
print(count)

Fixed submission:
import math
n = int(input())
a = [int(input()) for i in range(5)]
print(math.ceil(n/min(a[0],a[1],a[2],a[3],a[4]))+4)

Buggy python submission (verdict: Runtime Error):
nn = [0] * 6
nn[0] = n
count = 0
while nn[5] != n:
    idou_1 = min(a[0],nn[0])
    idou_2 = min(a[1],nn[1])
    idou_3 = min(a[2],nn[2])
    idou_4 = min(a[3],nn[3])
    idou_5 = min(a[4],nn[4])
    nn[0] -= idou_1
    nn[1] += idou_1
    nn[1] -= idou_2
    nn[2] += idou_2
    nn[2] -= idou_3
    nn[3] += idou_3
    nn[3] -= idou_4
    nn[4] += idou_4
    nn[4] -= idou_5
    nn[5] += idou_5
    count += 1
print(count)

Fixed submission:
import math
n = int(input())
a = [int(input()) for i in range(5)]
print(math.ceil(n/min(a[0],a[1],a[2],a[3],a[4]))+4)
Buggy python submission (verdict: Runtime Error):
#ABC 091 B - Two Colors Card Game
import collections
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]
c = collections.Counter(s) - collections.Counter(t)
print(c.most_common()[0][1])

Fixed submission:
#ABC 091 B - Two Colors Card Game
import collections
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]
c = collections.Counter(s) - collections.Counter(t)
if not c:
    print(0)
else:
    print(c.most_common()[0][1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
x,y = 0, 0
tf = 0
hantei = False
for i in range(n):
    t,a,b = list(map(int, input().split()))
    if (a + b) > t or (a + b + t) % 2 == 1:
        print('No')
        exit()
print('Yes')

Fixed submission:
a, b = map(int,input().split())
if (a * b) % 2 == 0:
    print('Even')
else:
    print('Odd')
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = []
for i in range(0, n):
    l.append(int(input()))
print(len(set(l)))

Fixed submission:
s = input()
print(s.replace('2017','2018'))

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = []
for i in range(0, n):
    l.append(int(input()))
print(len(set(l)))

Fixed submission:
s = input()
print(s.replace('2017','2018'))
Buggy python submission (verdict: Time Limit Exceeded):
n, y = list(map(int, input().split()))
nasi = True
for d in range(0,n+1):
    if nasi == False:
        break
    for e in range(0,(n+1)-d):
        if nasi == False:
            break
        for f in range(0,(n+1)-d-e):
            if nasi == False:
                break
            if (((10000 * d) + (5000 * e) + (1000 * f)) == y) & (d+e+f==n):
                nasi = False
                print(d,e,f)
                break
if nasi == True:
    print('-1 -1 -1')

Fixed submission:
n, y = list(map(int, input().split()))
nasi = True
for d in range(0,n+1):
    if nasi == False:
        break
    for e in range(0,(n+1)-d):
        if nasi == False:
            break
        f = n - d - e
        if ((10000 * d) + (5000 * e) + (1000 * f) == y):
            nasi = False
            print(d,e,f)
            break
if nasi == True:
    print('-1 -1 -1')

Buggy python submission (verdict: Time Limit Exceeded):
n, y = list(map(int, input().split()))
nasi = True
for d in range(0,n+1):
    if nasi == False:
        break
    for e in range(0,n+1):
        if nasi == False:
            break
        for f in range(0,n+1):
            if nasi == False:
                break
            if (((10000 * d) + (5000 * e) + (1000 * f)) == y) & (d+e+f==n):
                nasi = False
                print(d,e,f)
                break
if nasi == True:
    print('-1 -1 -1')

Fixed submission:
n, y = list(map(int, input().split()))
nasi = True
for d in range(0,n+1):
    if nasi == False:
        break
    for e in range(0,(n+1)-d):
        if nasi == False:
            break
        f = n - d - e
        if ((10000 * d) + (5000 * e) + (1000 * f) == y):
            nasi = False
            print(d,e,f)
            break
if nasi == True:
    print('-1 -1 -1')
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())

print(a+int(b/2))

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

print(a+int(b/2))
Buggy python submission (verdict: Runtime Error):
s=list(input())
a=0
for i in range(s):
    if s[i]=='1':
        a=a+1

print(a)



Fixed submission:
s=input()
a=0
for i in range(len(s)):
    if s[i]=="1":
        a=a+1

print(a)
Buggy python submission (verdict: Runtime Error):
# https://img.atcoder.jp/abc123/editorial.pdf
# 問題D: Cake 123 解法 #3 - さらに高速な解法、priority-queue を用いて O(K log K)

from heapq import heappush, nlargest

def solve(X, Y, Z, K, A, B, C):
    A.sort(reverse=True)
    B.sort(reverse=True)
    C.sort(reverse=True)

    Q = []
    for a in A:
        for b in B:
            heappush(Q, a+ b)
    AB = nlargest(K, Q)

    Q2 = []
    for ab in AB:
        for c in C:
            heappush(Q2, ab + c)
    ABC = nlargest(K, Q2)
    print("\n".join(map(str, ABC)))

if __name__ == "__main__":
    X, Y, Z, K = list(map(int, input().split()))
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))
    solve(X, Y, Z, K, A, B, C)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
dists = [a, b, c, d, e]
if max(dists) - min(dists) > k:
    print(":(")
else:
    print("Yay!")
Buggy python submission (verdict: Runtime Error):
N, A, B, C = map(int, input().split())
l = [int(input()) for i in range(N)]
INF = 10 ** 9
def dfs(cur, a, b, c):
	if cur == N:
		return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else INF
	ret0 = dfs(cur + 1, a, b, c)
	ret1 = dfs(cur + 1, a + l[cur], b, c) + 10
	ret2 = dfs(cur + 1, a, b + l[cur], c) + 10
	ret3 = dfs(cur + 1, a, b, c + l[cur]) + 10
	return min(ret0, ret1, ret2, ret3)
print(dfs(0, 0, 0, 0))

Fixed submission:
import datetime
raw = input()
date_formatted = datetime.datetime.strptime(raw, "%Y/%m/%d")
if date_formatted <= datetime.datetime(2019, 4, 30):
    print("Heisei")
else:
    print("TBD")
Buggy python submission (verdict: Runtime Error):
N, A, B, C = map(int, input().split())
l = [int(input()) for i in range(N)]
INF = 10 ** 9
def dfs(cur, a, b, c):
	if cur == N:
	return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else INF
	ret0 = dfs(cur + 1, a, b, c)
	ret1 = dfs(cur + 1, a + l[cur], b, c) + 10
	ret2 = dfs(cur + 1, a, b + l[cur], c) + 10
	ret3 = dfs(cur + 1, a, b, c + l[cur]) + 10
	return min(ret0, ret1, ret2, ret3)
print(dfs(0, 0, 0, 0))

Fixed submission:
N, A, B, C = map(int, input().split())
l = [int(input()) for i in range(N)]
INF = 10 ** 9
def dfs(cur, a, b, c):
	if cur == N:
		return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else INF
	ret0 = dfs(cur + 1, a, b, c)
	ret1 = dfs(cur + 1, a + l[cur], b, c) + 10
	ret2 = dfs(cur + 1, a, b + l[cur], c) + 10
	ret3 = dfs(cur + 1, a, b, c + l[cur]) + 10
	return min(ret0, ret1, ret2, ret3)
print(dfs(0, 0, 0, 0))
Buggy python submission (verdict: Runtime Error):
import math
DATA = input()

N,X = DATA.split()
N = int(N)
X = int(X)

DATA = input()
x = DATA.split()

x[0] = int(x[0])
num = abs(X-x[0])

for lop in range(1,N):
    x[lop] = int(x[lop])
    sa = abs(X-x[lop])
    num = math.gcd(num,sa)
print(num)

Fixed submission:
def gcd(A,B):
    deka = max(A,B)
    mini = min(A,B)
    
    while not deka % mini == 0:       
        yo = deka % mini
        deka = mini
        mini = yo
    return mini


DATA = input()

N,X = DATA.split()
N = int(N)
X = int(X)

DATA = input()
x = DATA.split()

x[0] = int(x[0])
num = abs(X-x[0])

for lop in range(1,N):
    x[lop] = int(x[lop])
    sa = abs(X-x[lop])
    num = gcd(num,sa)
print(num)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
A = input();
B = input();
K = input();

for lop in range(int(A),int(A)+int(K)):
    if lop > int(B):
        break;
    print(lop);
    fg = lop;
        
if int(B)-int(K)+1 >= int(A):
    if fg+1 < int(B)-int(K)+1:
        fg = int(B)-int(K)+1;
    else:
        fg+=1
    for lop in range(fg,int(B)):
        print(lop);
    print(B);

Fixed submission:
# -*- coding: utf-8 -*-
data = input().split(" ");
A = data[0];
B = data[1];
K = data[2];

for lop in range(int(A),int(A)+int(K)):
    if lop > int(B):
        break;
    print(lop);
    fg = lop;
        
if int(B)-int(K)+1 >= int(A):
    if fg+1 < int(B)-int(K)+1:
        fg = int(B)-int(K)+1;
    else:
        fg+=1
    for lop in range(fg,int(B)+1):
        print(lop);