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

Fixed submission:
#-*- coding: utf-8 -*-

#入力
s = raw_input()

l = list(s)

count = 0
cl = []

for x in l:
    if x == "A" or x == "C" or x =="G" or x == "T":
        count += 1
    else:
        cl.append(count)
        count = 0
cl.append(count)

#print(cl)
print(max(cl))

Buggy submission (verdict: Runtime Error):
#-*- coding: utf-8 -*-

#入力
s = raw_input()

l = list(s)

count = 0
cl = []

for x in l:
    if x == "A" or x == "C" or x =="G" or x == "T":
        count += 1
    else:
        cl.append(count)
        count = 0

#print(cl)
print(max(cl))
Problem p03105 (python)

Fixed submission:
a,b,c = map(int,input().split())
if b//a <= c:
    print(b//a)
else:
    print(c)

Buggy submission (verdict: Runtime Error):
a,b,c = int(input().split())
if b//a <= c:
    print(b//a)
else:
    print(c)
Problem p03110 (python)

Fixed submission:
n = int(input())
sum = 0
for i in range(n):
    x,u = input().split()
    if u == "JPY":
        sum += float(x)
    else:
        sum += float(x)*380000
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
sum = 0
for i in range(n):
    x,u = input()
    if u == "JPY":
        sum += float(x)
    else:
        sum += float(x)*380000
print(sum)
Problem p03126 (python)

Fixed submission:
n,m = map(int,input().split())
foodlike = [0]*m
for i in range(n):
    data = list(map(int,input().split()))
    for j in range(data[0]):
        foodlike[data[j+1] - 1] += 1
print(foodlike.count(n))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
foodlike = [0]*m
for i in range(n):
    data = list(map(int,input().split()))
    for j in range(data[0]):
        foodlike[data[j-1]] += 1
print(foodlike.count(n))
Problem p03240 (python)

Fixed submission:
n = int(input())
xyh = sorted([list(map(int,input().split())) for i in range(n)],key=lambda x:x[2])[::-1]
flag = 0
for x in range(101):
    for y in range(101):
        H = abs(xyh[0][0]-x) + abs(xyh[0][1]-y)+xyh[0][2]
        for i in range(n):
            if not((xyh[i][2] == 0 and H - abs(xyh[i][0]-x) - abs(xyh[i][1]-y) <= 0) or H - abs(xyh[i][0]-x) - abs(xyh[i][1]-y) == xyh[i][2]):
                break
            if i == n-1:
                flag = 1
        if flag == 1:
            ans = [x,y,H]
            break
    if flag == 1:
        break
print(str(ans[0])+" "+str(ans[1])+" "+str(ans[2]))

Buggy submission (verdict: Runtime Error):
n = int(input())
xyh = [list(map(int,input().split())) for i in range(n)]
flag = 0
for x in range(101):
    for y in range(101):
        for i in range(n-1):
            if xyh[i][2] - xyh[i+1][2] + abs(xyh[i][0] - x) + abs(xyh[i][1] - y) - abs(xyh[i+1][0] - x) - abs(xyh[i+1][1] - y) != 0:
                break
            if i == n-2:
                flag = 1
        if flag == 1:
            ans = [x,y]
            break
    if flag == 1:
        break
ans.append(xyh[0][2] + abs(xyh[0][0] - ans[0]) + abs(xyh[0][1] - ans[1]))
print(str(ans[0])+" "+str(ans[1])+" "+str(ans[2]))
Problem p03282 (python)

Fixed submission:
s = input()
k = int(input())
onesum = 0
while s[0] == "1":
    onesum += 1
    if len(s) == 1:
        break
    s = s[1:]
if k <= onesum:
    print(1)
else:
    print(s[0])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
onesum = 0
while s[0] == "1" and len(s) > 0:
    s = s[1:]
    onesum += 1
if k <= onesum:
    print(1)
else:
    print(s[0])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
onesum = 0
while s[0] == "1" and len(s) > 0
    s = s[1:]
    onesum += 1
if k <= onesum:
    print(1)
else:
    print(s[0])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
onesum = 0
while s[0] == "1":
    s = s[1:]
    onesum += 1
if k <= onesum:
    print(1)
else:
    print(s[0])
Problem p03434 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
countAlice = 0
countBob = 0
for i in range(n):
    if i%2 == 0:
        countAlice += a[i]
    else:
        countBob += a[i]
print(countAlice-countBob)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
countAlice = 0
countBob = 0
for i in range(n):
    if i%2 == 0:
        countAlice += a[i]
    else:
        countBob += a[i]
print(coutAlice-countBob)
Problem p03448 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
maxa = min([a,x//500])
maxb = min([b,x//100])
maxc = min([c,x//50])
count = 0
for i in range(maxa + 1):
    for j in range(maxb + 1):
        for k in range(maxc + 1):
            if 10*i + 2*j + k == x/50:
                count += 1
print(count)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
maxa = min([a,x//500])
maxb = min([b,x//100])
maxc = min([c,x/50])
count = 0
for i in range(maxa + 1):
    for j in range(maxb + 1):
        for k in range(maxc + 1):
            if 10*i + 2*j + k == x/50:
                count += 1
print(count)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
maxa = min([a,x//500])
maxb = min([b,x//100])
maxc = min([c,x/50])
count = 0
for i in range(maxa + 1):
    for j in range(maxb + 1):
        for k in range(maxc + 1):
            if 10*i + 2*j + k == x/50:
                count += 1
print(count)
Problem p03076 (python)

Fixed submission:
# -*- coding: utf-8 -*-

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

all = 0

all += (a // 10) * 10
if (a % 10) != 0:
    all += 10

all += (b // 10) * 10
if (b % 10) != 0:
    all += 10

all += (c // 10) * 10
if (c % 10) != 0:
    all += 10

all += (d // 10) * 10
if (d % 10) != 0:
    all += 10

all += (e // 10) * 10
if (e % 10) != 0:
    all += 10

l = [(a % 10), (b % 10), (c % 10), (d % 10), (e % 10)]
l = [x for x in l if x != 0]

#print(l)
if len(l) != 0:
    mi = min(l)
    if mi != 0:
        all -= (10 - mi)

print(all)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

all = 0

all += (a // 10) * 10
if (a % 10) != 0:
    all += 10

all += (b // 10) * 10
if (b % 10) != 0:
    all += 10

all += (c // 10) * 10
if (c % 10) != 0:
    all += 10

all += (d // 10) * 10
if (d % 10) != 0:
    all += 10

all += (e // 10) * 10
if (e % 10) != 0:
    all += 10

l = [(a % 10), (b % 10), (c % 10), (d % 10), (e % 10)]
l = [x for x in l if x != 0]

#print(l)

mi = min(l)
if mi != 0:
    all -= (10 - mi)

print(all)
Problem p03563 (python)

Fixed submission:
R = (int)(input())
G = (int)(input())
answer = 2 * G - R
print(answer)

Buggy submission (verdict: Runtime Error):
a
Problem p03076 (python)

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

x=[a,b,c,d,e]

l10=[int(i) for i in x if i % 10==0]
res=x
for n in l10:
    res.remove(n)

if not len(l10)==5:
    min_d=9
    for i in res:
        if int(str(i)[-1])<=min_d:
            min_d=int(str(i)[-1])
            min_num=i
    
    re2=res
    
    re2.remove(min_num)
    
    s=0
    for si in re2:
        if len(str(si))==2:
            s+=int(str(si)[0])*10+10
        elif len(str(si))==1:
            s+=10
        else:
            s+=int(str(si)[:-1])*10+10 
    print(sum(l10)+min_num+s)
else:
    print(sum(l10))

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

x=[a,b,c,d,e]

l10=[int(i) for i in x if i % 10==0]
res=x
for n in l10:
    res.remove(n)

if not len(l10)==5:
    min_d=9
    for i in res:
        if int(str(i)[-1])<min_d:
            min_d=int(str(i)[-1])
            min_num=i
    
    re2=res
    
    re2.remove(min_num)
    
    s=0
    for si in re2:
        if len(str(si))==2:
            s+=int(str(si)[0])*10+10
        elif len(str(si))==1:
            s+=10
        else:
            s+=int(str(si)[:-1])*10+10 
    print(sum(l10)+min_num+s)
else:
    print(sum(l10))

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

l10=[int(i) for i in x if i % 10==0]
res=[]
for n in x:
    if n not in l10:
        res.append(n)

if not len(l10)==5:
    min_d=9
    for i in res:
        if int(str(i)[-1])<min_d:
            min_d=int(str(i)[-1])
            min_num=i
    
    re2=[]
    for m in res:
        if m != min_num:
            re2.append(m)
    
    s=0
    for si in re2:
        if len(str(si))==2:
            s+=int(str(si)[0])*10+10
        elif len(str(si))==1:
            s+=10
        else:
            s+=int(str(si)[:-1])*10+10 
    print(sum(l10)+min_num+s)
else:
    print(sum(l10))

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

x=[a,b,c,d,e]

l10=[int(i) for i in x if i % 10==0]
res=[]
for n in x:
    if n not in l10:
        res.append(n)
min_d=9
if not len(l10)==5:
    for i in res:
        if int(str(i)[-1])<min_d:
            min_d=int(str(i)[-1])
            min_num=i
    
    re2=[]
    for m in res:
        if m != min_num:
            re2.append(m)
    
    s=0
    for si in re2:
        if len(str(si))==2:
            s+=int(str(si)[0])*10+10
        elif len(str(si))==1:
            s+=10
        else:
            s+=int(str(si)[:-1])*10+10 
    print(sum(l10)+min_num+s)
else:
    print(sum(l10))
Problem p03351 (python)

Fixed submission:
a,b,c,d=map(int, input().split())
E=abs(b-a)
F=abs(c-b)
G=abs(c-a)
if E<=d and F<=d:
	print("Yes")
elif G<=d:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
ans=1
for i in range(1,N):
    if i*i<=N:
        ans=i*i
print(ans)
Problem p03407 (python)

Fixed submission:
A,B,C=map(int, input().split())
if A+B>=C:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
A,B,C=map(int(input().split()))
if A+B>=C:
	print("Yes")
else:
	print("No")
Problem p03415 (python)

Fixed submission:
A=input()
B=input()
C=input()
target=A
D=target[0]
target=B
E=target[1]
target=C
F=target[2]
print(D+E+F)

Buggy submission (verdict: Runtime Error):
c11,c12,c13=input().split()
c21,c22,c23=input().split()
c31,c32,c33=input().split()
print(c11,c22,c33)
Problem p03760 (python)

Fixed submission:
O=input()
E=input()
T=""
if len(O)-len(E)==0:
  for i in range(len(O)):
    T += O[i]+ E[i]
  print(T)
else:
  for i in range(len(E)):
    T += O[i]+ E[i]
  T+=O[-1]
  print(T)

Buggy submission (verdict: Runtime Error):
O=input()
E=input()
T=""
for i in range(len(O)):
    T += O[i]+ E[i]
print(T)
Problem p03860 (python)

Fixed submission:
S=input()
print(S[0]+S[8]+S[-7])

Buggy submission (verdict: Runtime Error):
a,b,x = map(int, input().split())
T = []
for i in range(a,b+1):
	if i%x==0:
		T.append(i)
	else:
		quit
print(len(T))
Problem p03502 (python)

Fixed submission:
# -*- coding: utf-8 -*-
N = int, input()
num = str(N[1])
char_list = list(num)
sum = 0
for i in range(len(char_list)):
    sum += int(char_list[i])

if int(N[1]) % sum == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = int, input()
num = str(N[1])
char_list = list(num)
sum = 0
for i in range(len(char_list)):
    sum += int(char_list[i])

if N[1] % sum == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = int, input()
print(N)
num = str(N[1])
char_list = list(num)
sum = 0
for i in range(len(char_list)):
    sum += int(char_list[i])

if N[1] % sum == 0:
    print("Yes")
else:
    print("No")
Problem p03543 (python)

Fixed submission:
# -*- coding: utf-8 -*-
N = str, input()
out = "No"
N_list = list(N[1])

if N_list[0]==N_list[1] and N_list[0]==N_list[2]:
    out = "Yes"
elif N_list[1]==N_list[2] and N_list[1]==N_list[3]:
    out = "Yes"

print(out)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = map(str, input().split())
out = "No"
N_list = list(N)
if N_list[0]==N_list[1] and N_list[0]==N_list[2]:
    out = "Yes"
elif N_list[1]==N_list[2] and N_list[1]==N_list[3]:
    out = "Yes"

print(out)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = map(str, input().split())
out = "No"
N_list = list(N)
if N_list[0]==N_list[1] and N_list[0]==N_list[2]:
    out = "Yes"
elif N_list[1]==N_list[2] and N_list[1]==N_list[3]:
    out = "Yes"

print(out)
Problem p03545 (python)

Fixed submission:
# -*- coding: utf-8 -*-
ABCD = str, input()
ABCD_list = list(ABCD[1])
A = int(ABCD_list[0])
B = int(ABCD_list[1])
C = int(ABCD_list[2])
D = int(ABCD_list[3])
if A+B+C+D == 7:
    print(str(A)+"+"+str(B)+"+"+str(C)+"+"+str(D)+"=7")
elif A-B+C+D == 7:
    print(str(A)+"-"+str(B)+"+"+str(C)+"+"+str(D)+"=7")
elif A+B-C+D == 7:
    print(str(A)+"+"+str(B)+"-"+str(C)+"+"+str(D)+"=7")
elif A-B-C+D == 7:
    print(str(A)+"-"+str(B)+"-"+str(C)+"+"+str(D)+"=7")
elif A+B+C-D == 7:
    print(str(A)+"+"+str(B)+"+"+str(C)+"-"+str(D)+"=7")
elif A-B+C-D == 7:
    print(str(A)+"-"+str(B)+"+"+str(C)+"-"+str(D)+"=7")
elif A+B-C-D == 7:
    print(str(A)+"+"+str(B)+"-"+str(C)+"-"+str(D)+"=7")
elif A-B-C-D == 7:
    print(str(A)+"-"+str(B)+"-"+str(C)+"-"+str(D)+"=7")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
A, B, C, D = map(int, input().split())

if A+B+C+D == 7:
    print("A+B+C+D =7")
elif A-B+C+D == 7:
    print("A-B+C+D =7")
elif A+B-C+D == 7:
    print("A+B-C+D =7")
elif A-B-C+D == 7:
    print("A-B-C+D =7")
elif A+B+C-D == 7:
    print("A+B+C-D =7")
elif A-B+C-D == 7:
    print("A-B+C-D =7")
elif A+B-C-D == 7:
    print("A+B-C-D =7")
elif A-B-C-D == 7:
    print("A-B-C-D =7")
Problem p03547 (python)

Fixed submission:
# -*- coding: utf-8 -*-
X, Y = map(str, input().split())
dic = {"A":10,"B":11,"C":12,"D":13,"E":14,"F":15,}
if dic[X]>dic[Y]:
    print(">")
elif dic[X]<dic[Y]:
    print("<")
elif dic[X]==dic[Y]:
    print("=")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
X, Y, Z = map(int, input().split())
print(int((X-Z)/(Y+Z)))
Problem p03079 (python)

Fixed submission:
a,b,c = map(int,input().split())
if a+b>c and a+c>b and b+c>a:
  if a==b==c:
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a+b>c and a+c>b and b+c>a:
  if a=b=c:
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
x,y,z = map(int,input().split())
if x = y = z:
  print('Yes')
else:
  print('No)
Problem p03963 (python)

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

Buggy submission (verdict: Runtime Error):
import math

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

a,b = map(int,input().split())
print(permutations_count(a,b))
Problem p03997 (python)

Fixed submission:
import math 
a = int(input())
b = int(input())
c = int(input())

print(math.floor((a+b)*c/2))

Buggy submission (verdict: Runtime Error):
cards = [input() for i in range(3)]

now = 0
index =[0,0,0]
dic={"a":0,"b":1,"c":2}

while True:
    if index[now] == len(cards[now]):
        break
    idx = index[now]
    index[now] += 1
    now = dic[cards[now][idx]]
    

print("ABC"[now])
Problem p04030 (python)

Fixed submission:
s = input()

res = ""
for x in s:
    if x =="B":
        res = res[:-1]
    else:
        res += x

print(res)

Buggy submission (verdict: Runtime Error):
n = list(input())
m = []

for i in n:
  if i == '0':
    m.append(0)
  elif i == '1':
    m.append(1)
  elif i == 'B':
    del m[-1]
    
ans = ''.join(map(str,m))
print(ans)
Problem p03086 (python)

Fixed submission:
S = list(input())
ACGT = []
tmp = ""
for i, s in enumerate(S):
    if s == "A" or s == "C" or s == "G" or s == "T":
        tmp += s
        if i == len(S)-1:
            ACGT.append(tmp)
            break
    else:
        ACGT.append(tmp)
        tmp = ""

print(len(sorted(ACGT, key=lambda x: len(x))[len(ACGT)-1]))

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

ACGT = []
tmp = ""
for s in S:
    if s == "A" or s == "C" or s == "G" or s == "T":
        tmp += s
    else:
        ACGT.append(tmp)
        tmp = ""

print(len(sorted(ACGT, key=lambda x: len(x))[len(ACGT)-1]))
Problem p03085 (python)

Fixed submission:
b = input()
if b=="A":
  print("T")
elif b=="T":
  print("A")
elif b=="C":
  print("G")
elif b=="G":
  print("C")

Buggy submission (verdict: Runtime Error):
b = input()
if b=="A":
  print("T")
elif b=="T":
  print("A")
elif b=="G":
  print("C")
else
  print("G")
Problem p03086 (python)

Fixed submission:
S = input()
L = len(S)
ACGT = ["A","C","T","G"]
ctr = 0
ctrs = [0]
for l in range(L):
  if S[l] in ACGT:
    ctr += 1
    if l==L-1:
      ctrs.append(ctr)
  else:
    ctrs.append(ctr)
    ctr = 0
 
print(max(ctrs))

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

ACGT = ["A","C","T","G"]
ctr = 0
ctrs = []
for c in S:
  if c in ACGT:
    ctr += 1
  else:
    ctrs.append(ctr)
    ctr = 0

print(max(ctrs))
Problem p03219 (python)

Fixed submission:
X, Y = [int(i) for i in input().split()]

ans = X + (int(Y/2))

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = [int(i) for i in input().split()]
H = list(map(int, input().split()))
compare = []

for i in range(N):
    kion = T - H[i]*0.006
    compare.append(abs(kion - A))
    Min = min(compare)
    #print('kion{}'.format(kion))
    #print('差：{}'.format(abs(kion - A)))
print(compare.index(Min)+1)
#print(T,A)
#print(H)
#print('compare:{}'.format(compare))
Problem p03227 (python)

Fixed submission:
S = input()
S_len = len(S)
S_list = list(S)
ans = ''

if S_len == 2:
    print(S)

elif S_len == 3:
    for i in range(S_len-1, -1, -1):
        ans += S_list[i]
    print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
S_len = len(S)
S_list = list(S)
ans = ''

if S_len == 2:
    print(S)

elif S_len == 3:
    S_reverse = sorted(S, reverse=True)
    for i in range(S_len):
        ans += S_reverse[i]
    pr
Problem p03284 (python)

Fixed submission:
N, K = [int(i) for i in input().split()]

if N % K != 0:
    print('1')
    exit()
print('0')

Buggy submission (verdict: Runtime Error):
N = int(input())
cake = int(N/4)
donuts = int(N/7)

for i in range(donuts+1):
    for m in range(cake+1):
        sum_price = i*7 + m*4
        if N == sum_price:
            print('Yes')
            exit()

print('No')
Problem p03101 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input().split())
b = int(input().split())
c = a[0] * b[1]
d = a[1] * b[0]
print(a[0] * a[1] - (c + d - b[0] * b[1]))

Buggy submission (verdict: Runtime Error):
a = input().split()
b = input().split()
c = a[0] * b[1]
d = a[1] * b[0]
print(a[0] * a[1] - (c + d - b[0] * b[1]))
Problem p03102 (python)

Fixed submission:
c = input().split()
c = list(map(int, c))
b = input().split()
b = list(map(int, b))
ans = 0
a = [0] * (c[0])
for n in range(c[0]):
	a[n] = input().split()
	a[n] = list(map(int, a[n]))
	tmp = 0
	for m in range(c[1]):
		tmp += b[m] * a[n][m]
	if tmp > -c[2]:
		ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
c = input().split()
c = list(map(int, c))
b = input().split()
b = list(map(int, b))
ans = 0
for n in range(c[0]):
	a[n] = input().split()
	a[n] = list(map(int, a[n]))
	tmp = 0
	for m in range(c[1]):
		tmp += b[m] * a[n][m]
	if tmp > -c[2]:
		ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
c = input().split()
c = list(map(int, a))
b = input().split()
b = list(map(int, a))
ans = 0
for n in range(c[0]):
	a[n] = input().split()
	a[n] = list(map(int, a[n]))
	tmp = 0
	for m in range(c[1]):
		tmp += b[m] * a[n][m]
	if tmp > -c[2]:
		ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
c = int(input().split())
b = int(input().split())
ans = 0
for n in range(c[0]):
	a[n] = int(input().split())
	tmp = 0
	for m in range(c[1]):
		tmp += b[m] * a[n][m]
	if tmp > -c[2]:
		ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
c = input().split()
b = input().split()
ans = 0
for n in range(c[0]):
	a[n] = input().split()
	tmp = 0
	for m in range(c[1]):
		tmp += b[m] * a[n][m]
	if tmp > -c[2]:
		ans += 1
print(ans)
Problem p03206 (python)

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

Buggy submission (verdict: Runtime Error):
in_t = input().split()
n = int(in_t[0])
k = int(in_t[1])
list = []
for i in range(k):
 list.append(int(input()))
for i in range(n - k):
 new = int(input())
 if (list[k-1] > new) | (new > list[2]):
  list.append(new)
  list.sort()
  diff_max = list[k-1] - list[k-2]
  diff_min = list[1] - list[2]
  if (diff_max > diff_min):
   list.remove(list[0])
  else:
    list.remove(list[k-1])
print(list[k-1] - list[0])
Problem p03076 (python)

Fixed submission:
dish = [0]*5
inv = [0]*5

for i in range(5):
  dish[i] = int(input())
  inv[i] = (10-dish[i]%10)%10
  
cost = sum(dish) + sum(inv) - max(inv)
print(cost)

Buggy submission (verdict: Runtime Error):
def z(x):
  if x == 0:
  	return 10
  else:
    return x
menu = [int(input()) for i in range(5)]
dist = list(map(lambda x: x%10, menu))
dist2 = list(map(lambda x: z(x), dist))
idx = dist.index(min(dist2))
dist2.pop(idx)
inv = list(map(lambda x: 10-x, dist2))
cost = sum(menu) + sum(inv)
print(cost)

Buggy submission (verdict: Runtime Error):
def z(x):
  if x == 0:
  	return 10
  else:
    return x

menu = [int(input()) for i in range(5)]
dist = list(map(lambda x: x%10, menu))
dist2 = list(map(lambda x: z(x), dist))
idx = dist.index(min(dist2))
dist2.pop(idx)
inv = list(map(lambda x: 10-x, dist2))
cost = sum(menu) + sum(inv)
print(cost)
Problem p03219 (python)

Fixed submission:
X, Y = map(int, input().split())
print(X + Y//2)

Buggy submission (verdict: Runtime Error):
p_y = []
p_y_dict = {}

N, M = map(int, input().split())
for i in range(M):
  p, y = map(int, input().split())
  p_y.append([p, y])
  p_y_dict.setdefault(p, []).append(y)

sorted_py_dict = {p: sorted(y) for p, y in p_y_dict.items()}

for a in p_y: 
  print(str(a[0]).zfill(6) + str(sorted_py_dict[a[0]].index(a[1]) + 1).zfill(6))
Problem p03455 (python)

Fixed submission:
from sys import stdin
 
a, b = map(int, input().split())
if (a*b) % 2:
    print("Odd")
else:
    print("Even")

Buggy submission (verdict: Runtime Error):
from sys import stdin

a, b = stdin.readline().rstrip().split()
if (a*b) % 2:
    print("Odd")
else:
    print("Even")
Problem p03545 (python)

Fixed submission:
N = [int(i) for i in input()] 

flag = ["","",""]

for i in range(1 << len(N)-1):
	result = N[0]
	for j in range(len(N)-1):
		if ((i >> j) & 1) == 1:
			result += N[j+1]
			flag[j] = "+"
		else:
			result -= N[j+1]
			flag[j] = "-"

	if result == 7:
		break

print("%d%s%d%s%d%s%d=7" %(N[0],flag[0],N[1],flag[1],N[2],flag[2],N[3]))

Buggy submission (verdict: Runtime Error):
N = [int(i) for i in input().split()] 

flag = ["","",""]

for i in range(1 << len(N)-1):
	print("i:", i)
	result = N[0]
	for j in range(len(N)-1):
		print("j:", j)
		if ((i >> j) & 1) == 1:
			result += N[j+1]
			flag[j] = "+"
		else:
			result -= N[j+1]
			flag[j] = "-"

	print("result:", result)

	if result == 7:
		break

print("%d%s%d%s%d%s%d=7" %(N[0],flag[0],N[1],flag[1],N[2],flag[2],N[3]))
Problem p03076 (python)

Fixed submission:
a=[]
for i in range(5):
    a.append(int(input()))
ans=0
min=10
minn=0
for i in range(5):
    if (a[i]%10<=min and a[i]%10!=0):
        min=a[i]%10
        minn=i
for i in range(5):
    if a[i]%10!=0:
        b=(a[i]//10)
        ans=ans+b*10+10
    elif a[i]==0:
        ans+=10
    else:
        ans=ans+a[i]
if min!=10:
    print(ans-(10-a[minn]%10))
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
a=[]
for i in range(5):
    a.append(int(input()))
ans=0
min=10
minn=0
for i in range(5):
    if a[i]%10<=min and a[i]%10!=0:
        min=a[i]%10
        minn=i
for i in range(5):
    if a[i]%10!=0:
        b=(a[i]//10)
        ans=ans+b*10+10
    else if a[i]=0:
        ans+=10
    else:
        ans=ans+a[i]
print(ans-(10-a[minn]%10))