qyliang/CodeNanoFix huggingface dataset:
Buggy code:
dishes_1 = [int(input()) for i in range(5)]
dishes_2 = [i % 10 for i in dishes_1]
dishes_sort = []

min_time = 0

for i in range (5):
    if dishes_2[i] == 0:
       dishes_sort.append(dishes_1[i])

for i in range (9, 1, -1):
    for j in range (5):
        if dishes_2[j] == i:
            dishes_sort.append(dishes_1[j])

for i in range (4):
    for j in range (9):
        if dishes_sort[i] % 10 == 0:
           break
        else:
            dishes_sort[i] += 1
            
print (sum(dishes_sort))

Fixed code:
dishes_1 = [int(input()) for i in range(5)]
dishes_2 = [i % 10 for i in dishes_1]
dishes_sort = []

min_time = 0

for i in range (5):
    if dishes_2[i] == 0:
       dishes_sort.append(dishes_1[i])

for i in range (9, 0, -1):
    for j in range (5):
        if dishes_2[j] == i:
            dishes_sort.append(dishes_1[j])

for i in range (4):
    for j in range (9):
        if dishes_sort[i] % 10 == 0:
           break
        else:
            dishes_sort[i] += 1
            
print (sum(dishes_sort))
Buggy code:
def resolve():
    import math
    a = [int(input()) for _ in range(5)]
    b = []
    for i in range(5):
        if a[i]%10 != 0:
            b.append(a[i]%10)
    if b == []
        amin = 0
    else:
        amin = min(b)
    ans = 0
    for i in range(5):
        ans += math.ceil(a[i]/10)*10
    print(ans-10+amin)

resolve()

Fixed code:
def resolve():
    import math
    a = [int(input()) for _ in range(5)]
    b = []
    for i in range(5):
        if a[i]%10 != 0:
            b.append(a[i]%10)
    if len(b) == 0:
        amin = 10
    else:
        amin = min(b)
    ans = 0
    for i in range(5):
        ans += math.ceil(a[i]/10)*10
    print(ans-10+amin)

resolve()
Buggy code:
l =list(int(input()) for i in range(5))
a =[]
time = 0
for i in range(5):
  if l[i]%10!=0:
    a.append(l[i]%10)
  else:
    a.append(9)
#print(a)
b = a.index(min(a))
#print(b)
for i in range(5):
  time += (-(-l[i]//10))*10
  print(time)
time -= (-(-l[b]//10)*10) - l[b]
print(time)


Fixed code:
l =list(int(input()) for i in range(5))
a =[]
time = 0
for i in range(5):
  if l[i]%10!=0:
    a.append(l[i]%10)
  else:
    a.append(9)
#print(a)
b = a.index(min(a))
#print(b)
for i in range(5):
  time += (-(-l[i]//10))*10
  #print(time)
time -= (-(-l[b]//10)*10) - l[b]
print(time)
Buggy code:
import math
dishes = [int(input()) for _ in range(5)]
lead_times = [int(math.ceil(t/10))*10 - t in dishes]
max_idx = lead_times.index(max(lead_times))
result = 0
for i in range(5):
  result += dishes[i]
  if i != max_idx:
    result += lead_times[i]
print(result)

Fixed code:
import math
dishes = [int(input()) for _ in range(5)]
lead_times = [int(math.ceil(t/10))*10 - t for t in dishes]
max_idx = lead_times.index(max(lead_times))
result = 0
for i in range(5):
  result += dishes[i]
  if i != max_idx:
    result += lead_times[i]
print(result)
Buggy code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a=INT()
    b=INT()
    c=INT()
    d=INT()
    e=INT()
    ct=0
    alls=[a,b,c,d,e]
    for i in alls:
        if i%10!=0:
            ct+=(i//10+1)*10
        else:
            ct+=i
    ct=ct-(10-min(a%10,b%10,c%10,d%10,e%10))
    print(ct)
if __name__ == '__main__':
    do()

Fixed code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a=INT()
    b=INT()
    c=INT()
    d=INT()
    e=INT()
    ct=0
    alls=[a,b,c,d,e]
    for i in alls:
        if i%10!=0:
            ct+=(i//10+1)*10
        else:
            ct+=i
    f=max((10-a%10)%10,(10-b%10)%10,(10-c%10)%10,(10-d%10)%10,(10-e%10)%10,)
    ct=ct-f
        
    print(ct)
if __name__ == '__main__':
    do()
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

a_s = a + (10 - a%10)
a_a = a%10
b_s = b + (10 - b%10)
b_a = b%10
c_s = c + (10 - c%10)
c_a = c%10
d_s = d + (10 - d%10)
d_a = d%10
e_s = e + (10 - e%10)
e_a = e%10

answer = (a_s + b_s + c_s + d_s + e_s)

List =[]
List.append(a_a)
List.append(b_a)
List.append(c_a)
List.append(d_a)
List.append(e_a)
List.sort()

for i in range(5):
    if(List[i] != 0):
        answer = answer - (10-List[i])
        break

print(answer)

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

a_s = (a + (10 - a%10) if (a%10 != 0) else a)
a_a = a%10
b_s = (b + (10 - b%10) if (b%10 != 0) else b)
b_a = b%10
c_s = (c + (10 - c%10) if (c%10 != 0) else c)
c_a = c%10
d_s = (d + (10 - d%10) if (d%10 != 0) else d)
d_a = d%10
e_s = (e + (10 - e%10) if (e%10 != 0) else e)
e_a = e%10

answer = (a_s + b_s + c_s + d_s + e_s)

List =[]
List.append(a_a)
List.append(b_a)
List.append(c_a)
List.append(d_a)
List.append(e_a)
List.sort()

for i in range(5):
    if(List[i] != 0):
        answer = answer - (10-List[i])
        break

print(answer)
Buggy code:
from itertools import permutations
A_list = []
for i in range(5):
    A_list.append(int(input()))
nes = [0,1,2,3,4]
iterator = []
print(A_list)
for i in permutations(nes):
    iterator.append(i)
for i in iterator:
    temp = 0
    for j in i:
        if temp%10 != 0:
            temp += (10-temp%10)
        temp += A_list[j]
    if temp < min1:
        min1 = temp
print(temp)

Fixed code:
from itertools import permutations
A_list = []
for i in range(5):
    A = int(input())
    A_list.append(A)
nes = [0,1,2,3,4]
iterator = []
for i in permutations(nes):
    iterator.append(i)
min1 = 10**9
for i in iterator:
    temp = 0
    for j in i:
        if temp%10 != 0:
            temp += (10-temp%10)
        temp += A_list[j]
    if temp < min1:
        min1 = temp
print(min1)
Buggy code:
L = [int(input()) for i in range(5)]
LL = [i % 10 for i in L]
if LL == [0] * 5:
    print(sum(L))
else:
    L2 = LL[:]
    while 0 in L2:
        L2.remove(0)
    ma = min(L2)
    r = LL.index(ma)
    print(ma)
    print(L[r] + sum([L[i] if L[i] % 10 == 0 else L[i] + 10 - L[i] % 10 for i in [j for j in range(5) if j != r]]))


Fixed code:
L = [int(input()) for i in range(5)]
LL = [i % 10 for i in L]
if LL == [0] * 5:
    print(sum(L))
else:
    L2 = LL[:]
    while 0 in L2:
        L2.remove(0)
    ma = min(L2)
    r = LL.index(ma)
    print(L[r] + sum([L[i] if L[i] % 10 == 0 else L[i] + 10 - L[i] % 10 for i in [j for j in range(5) if j != r]]))
Buggy code:
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
nn = [a, b, c, d, e]
for i in nn:
    if i == a:
        chk = i%10
        last = i
    else:
        if chk > i%10:
            chk = i%10
            last = i
s = False
for i in nn:
    if s == False and i == last:
        ans += i
        s = True
    else:
        ans += i + (10 - i%10)
print(ans)

Fixed code:
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
nn = [a, b, c, d, e]
s = False
for i in nn:
    if s == False and i%10 != 0:
        chk = i%10
        last = i
        s = True
    elif s == False and i%10 == 0:
        pass
    elif s == True and i%10 != 0:
        if chk > i%10:
            chk = i%10
            last = i
if s == False:
    last = a
#print(last)
s = False
for i in nn:
    if s == False and i == last:
        ans += i
        s = True
    else:
        if i%10 == 0:
            ans += i
        else:
            ans += i + (10 - i%10)
    #print(ans)
print(ans)
Buggy code:
import math
l=[int(input()) for i in range(5)]
t=[]
for ll in l:
  t.append(math.ceil(t//10))
lis=[]
for i in range(5):
  lis.append(t[i]*10-l[i])
m=max(lis)
sum=0
for i in range(5):
  sum+=t[i]*10
print(sum-m)
  


Fixed code:
import math
l=[int(input()) for i in range(5)]
t=[]
for ll in l:
  t.append(math.ceil(ll/10))
lis=[]
for i in range(5):
  lis.append(t[i]*10-l[i])
m=max(lis)
sum=0
for i in range(5):
  sum+=t[i]*10
print(sum-m)
Buggy code:
import math
list=[int(input()) for x in range(5)]
list.sort(key=lambda x:x%10)
count=0
for l in list:
  if l%10==0:
    count+=1
if count==0:
  print(sum(list))
else:
  a=list[count]
  del list[count]
  ans=[]
  for t in list:
    ans.append(math.ceil(t/10)*10)
  print(sum(ans)+a)

Fixed code:
import math
list=[int(input()) for x in range(5)]
list.sort(key=lambda x:x%10)
count=0
for l in list:
  if l%10==0:
    count+=1
if count==5:
  print(sum(list))
else:
  a=list[count]
  del list[count]
  ans=[]
  for t in list:
    ans.append(math.ceil(t/10)*10)
  print(sum(ans)+a)
Buggy code:
lst = []
for i in range(5):
  n = int(input())
  lst.append([n % 10, n])
lst = sorted(lst)

res = 0
for i in range(5):
  if i == 0:
    res += lst[i][1]
  else:
    res += (lst[i][1] + 9) // 10 * 10
print(res)

Fixed code:
lst = []
for i in range(5):
  n = int(input())
  lst.append([(n - 1) % 10, n])
lst = sorted(lst)

res = 0
for i in range(5):
  if i == 0:
    res += lst[i][1]
  else:
    res += (lst[i][1] + 9) // 10 * 10
print(res)
Buggy code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
count=0
lis=[[A,A%10],[B,B%10],[C,C%10],[D,D%10],[E,E%10]]
lis.sort(key=lambda x:x[1], reverse=True)
#print(lis)

for i in range(len(lis)):
    if not(i==len(lis)-1):
        count=count+lis[i][0]+(10-lis[i][1])%10
    else:
        count=count+lis[i][0]
print(count)

Fixed code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
count=0
lis=[[A,((A%10)-1)%10],[B,((B%10)-1)%10],[C,((C%10)-1)%10],[D,((D%10)-1)%10],[E,((E%10)-1)%10]]
lis.sort(key=lambda x:x[1], reverse=True)
#print(lis)

for i in range(len(lis)):
    if not(i==len(lis)-1):
        count=count+lis[i][0]+(10-(lis[i][0])%10)%10
    else:
        count=count+lis[i][0]
print(count)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

l = [A,B,C,D,E]
sub = 10 - min([i%10 for i in l if i%10!==0])
M = []
for i in l:
  if i%10 == 0:
    M.append(i)
  else:
    M.append(((i//10)+1)*10)
print(sum(M)-sub)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

l = [A,B,C,D,E]
m = [i%10 for i in l if i%10!=0 ]
if len(m) == 0:
  sub = 0
else:
  sub = 10 - min(m)
M = []
for i in l:
  if i%10 == 0:
    M.append(i)
  else:
    M.append(((i//10)+1)*10)
print(sum(M)-sub)
Buggy code:
import itertools
import math

A = []
for i in range(5):
    A.append(float(input()))

B = list(itertools.permutations(A))
M = 123 * 5
for i in range(120):
    c = 0
    for j in range(4):
        c += math.ceil(B[i][j]/10) * 10
    c += B[i][4]
    M = min(M, c)
print(int(M))
  

Fixed code:
import itertools
import math

A = []
for i in range(5):
    A.append(float(input()))

B = list(itertools.permutations(A))
M = 500 * 5
for i in range(120):
    c = 0
    for j in range(4):
        c += math.ceil(B[i][j]/10) * 10
    c += B[i][4]
    M = min(M, c)
print(int(M))
Buggy code:
dish=[int(input()) for _ in range(5)]
count={str(i%10):[] for i in range(10,-1,-1)}
for t in dish:
	one=t%10
	count[str(one)].append(t)

ans=0
d=0
for k,v in count.items():
	if v!=[]:
		for c in v:
			if d>3:
				ans+=c
			else:
				ans+=math.ceil(c/10)*10
				d+=1
print(int(ans))

Fixed code:
import math

dish=[int(input()) for _ in range(5)]
count={str(i%10):[] for i in range(10,-1,-1)}
for t in dish:
	one=t%10
	count[str(one)].append(t)

ans=0
d=0
for k,v in count.items():
	if v!=[]:
		for c in v:
			if d>3:
				ans+=c
			else:
				ans+=math.ceil(c/10)*10
				d+=1
print(int(ans))
Buggy code:
import math
l = [int(input()) for _ in range(5)]

sorted(l, key= lambda x: (x-1)%10, reverse = True)
ans = 0

for i in range(4):
  ans += math.ceil(l[i] / 10) * 10
ans += l[-1]

print(ans)
  

Fixed code:
import math
l = [int(input()) for _ in range(5)]

l = sorted(l, key= lambda x: (x-1)%10, reverse = True)
ans = 0

for i in range(4):
  ans += math.ceil(l[i] / 10) * 10
ans += l[-1]

print(ans)
Buggy code:
X = [int(input(_)) for _ in range(5)]

S = [round(x + 4.9, -1) for x in X]
d = [round(x + 4.9, -1) - x for x in X]

print(int(sum(S) - max(d)))


Fixed code:
X = [int(input()) for _ in range(5)]

S = [round(x + 4.9, -1) for x in X]
d = [round(x + 4.9, -1) - x for x in X]

print(int(sum(S) - max(d)))
Buggy code:
l = [int(input()) for i in range(5)]
l_d = []
for i in l:
  if i % 10 == 0:
    l_d.append(0)
  else:
    n = (i//10+1)*10 - i
    l_d.append(n)
c = []
for i, j in zip(l_d, l):
  c.append([i, j])
  
from operator import itemgetter
c.sort(key=itemgetter(0))
a, b = zip(*c)
d = list(b)
for n, i in enumerate(list(d[:-1])):
  if i % 10 == 0:
    continue
  else:
    d[n] = (i//10+1)*10    
sum(d)

Fixed code:
l = [int(input()) for i in range(5)]
l_d = []
for i in l:
  if i % 10 == 0:
    l_d.append(0)
  else:
    n = (i//10+1)*10 - i
    l_d.append(n)
c = []
for i, j in zip(l_d, l):
  c.append([i, j])
  
from operator import itemgetter
c.sort(key=itemgetter(0))
a, b = zip(*c)
d = list(b)
for n, i in enumerate(list(d[:-1])):
  if i % 10 == 0:
    continue
  else:
    d[n] = (i//10+1)*10    
print(sum(d))
Buggy code:
a = [[0, int(input())] for i in range(5)]

for i in range(5):
    a[i][0] = a[i][1] % 10
    if a[i][0] == 0:
        a[i][0] = 10
        a[i][1] -= 10

a.sort(reverse=True)

ans = 0
for i in range(4):
    if a[i][0] == 10:
        ans += a[i][1] + 10
    else:
        ans += a[i][1] + (10 - a[i][0])

    print(ans)

ans += a[4][1]

print(ans)

Fixed code:
a = [[0, int(input())] for i in range(5)]

for i in range(5):
    a[i][0] = a[i][1] % 10
    if a[i][0] == 0:
        a[i][0] = 10
        a[i][1] -= 10

a.sort(reverse=True)

ans = 0
for i in range(4):
    if a[i][0] == 10:
        ans += a[i][1] + 10
    else:
        ans += a[i][1] + (10 - a[i][0])

ans += a[4][1]
if a[4][0] == 10:
    ans += 10

print(ans)
Buggy code:
a=sorted(list(map(int,[input()for i in range(5)])),key=lambda x:x%10)
if ''.join([str(i)[-1]for i in a])=='00000':print(sum(a));quit()
while str(a[0])[-1]=='0':
  a+=[a[0]]
  del a[0]
print(a)
print(sum([a[0]]+[10*(0--i//10)for i in a[1:]]))

Fixed code:
a=sorted(list(map(int,[input()for i in range(5)])),key=lambda x:x%10)
if ''.join([str(i)[-1]for i in a])=='00000':print(sum(a));quit()
while str(a[0])[-1]=='0':
  a+=[a[0]]
  del a[0]
print(sum([a[0]]+[10*(0--i//10)for i in a[1:]]))
Buggy code:
l = [int(input()) for _ in range(5)]

a = list(map(lambda x: x % 10, l))
for i in range(len(a)):
    if a[i] == 0:
        a[i] = 10
a
mini = min(a)
index = a.index(mini)
def calc(x):
    if x % 10 == 0:
        return x
    else:
        return 10 + (x // 10) * 10
ans = 0
for i in range(len(l)):
    if i == index:
        print(l[i])
        ans += l[i]
    else:
        add = calc(l[i])
        print(add)
        ans += add
print(ans)

Fixed code:
l = [int(input()) for _ in range(5)]

a = list(map(lambda x: x % 10, l))
for i in range(len(a)):
    if a[i] == 0:
        a[i] = 10
a
mini = min(a)
index = a.index(mini)
def calc(x):
    if x % 10 == 0:
        return x
    else:
        return 10 + (x // 10) * 10
ans = 0
for i in range(len(l)):
    if i == index:
        #print(l[i])
        ans += l[i]
    else:
        add = calc(l[i])
        #print(add)
        ans += add
print(ans)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
mozi = [a, b, c, d, e]
rup = [round(mozi[i], -1) if mozi[i] % 10 == 0 else
       round(mozi[i] + 5, -1)
       for i in range(len(mozi))]

amari = [mozi[i] % 10 for i in range(len(mozi))]

m_r_a = list(zip(mozi, rup, amari))
sorta_m_r_a =(sorted(m_r_a, key=lambda x:x[2], reverse=True))
dishes_4sum = 0
for i in range(4):
    dishes_4sum += sorta_m_r_a[i][1]
dishes_5sum = dishes_4sum + sorta_m_r_a[4][0]

print(dishes_5sum)

Fixed code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
mozi = [a, b, c, d, e]
rup = [round(mozi[i], -1) if mozi[i] % 10 == 0 else
       round(mozi[i] + 5, -1)
       for i in range(len(mozi))]

amari = [mozi[i] % 10 if mozi[i] % 10 != 0 else
         10 for i in range(len(mozi))]

m_r_a = list(zip(mozi, rup, amari))
sorta_m_r_a =(sorted(m_r_a, key=lambda x:x[2], reverse=True))

dishes_4sum = 0
for i in range(4):
    dishes_4sum += sorta_m_r_a[i][1]
dishes_5sum = dishes_4sum + sorta_m_r_a[4][0]

print(dishes_5sum)
Buggy code:
def rest(num):
    return num % 10

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
Foods = [A,B,C,D,E]
res = 0

poplist=[]
for idx in range(5):
    if Foods[idx]%10==0:
        res += Foods[idx]
        poplist.append(idx)
while len(poplist)>0:
    idx = max(poplist)
    Foods.pop(idx)
    poplist.pop(idx)

while len(Foods) > 0:
    idx = Foods.index(max(Foods, key=rest))
    if len(Foods)>1:
        res += (Foods[idx]//10)*10+10
    else:
        res += Foods[idx]
    Foods.pop(idx)



print(res)


Fixed code:
def rest(num):
    return num % 10

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
Foods = [A,B,C,D,E]
res = 0

poplist=[]
for idx in range(5):
    if Foods[idx]%10==0:
        res += Foods[idx]
        poplist.append(idx)
while len(poplist)>0:
    idx = max(poplist)
    Foods.pop(idx)
    poplist.pop(poplist.index(idx))

while len(Foods) > 0:
    idx = Foods.index(max(Foods, key=rest))
    if len(Foods)>1:
        res += (Foods[idx]//10)*10+10
    else:
        res += Foods[idx]
    Foods.pop(idx)



print(res)
Buggy code:
import math
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
raws = [A, B, C, D, E]
residues = [A % 10, B % 10, C % 10, D % 10, E % 10]
ans = 0
lastDish = residues.index(min(residues))
for i in range(len(raws)):
    if i != lastDish:
        ans += math.ceil(raws[i] / 10) * 10
    else:
        ans += raws[i]
print(ans)


Fixed code:
import math
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
raws = [A, B, C, D, E]
residues = []
for num in raws:
    if num % 10 != 0:
        residues.append(num % 10)
    else:
        residues.append(10)

ans = 0
lastDish = residues.index(min(residues))
for i in range(len(raws)):
    if i != lastDish:
        ans += math.ceil(raws[i] / 10) * 10
    else:
        ans += raws[i]
print(ans)
Buggy code:
a=[int(input()) for i in range(5)]
n=0
ans=0

for x in a:
  if x % 10 != 0:
    t=x%10
  else:
    t=0
  ans += x+t
  n=max(n,t)
print(ans)

Fixed code:
a = [int(input()) for i in range(5)]
n = 0
ans = 0
for x in a:
  if x % 10 != 0:
    t = 10 - x % 10
  else:
    t = 0
  ans += x + t
  n = max(n,t)
print(ans-n)
Buggy code:
import sys
import itertools
import math

"""
B - Five Dishes
https://atcoder.jp/contests/abc123/tasks/abc123_b
"""


def order(order_list):
    t1 = math.ceil(order_list[0] / 10) * 10
    t2 = t1 + math.ceil(order_list[1] / 10) * 10
    t3 = t2 + math.ceil(order_list[2] / 10) * 10
    t4 = t3 + math.ceil(order_list[3] / 10) * 10
    t5 = t4 + order_list[4]
    return t5


if __name__ == '__main__':
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())

    all_order = sorted([a, b, c, d, e])

    all_cases = list(itertools.permutations(all_order))

    min_time = sys.maxsize

    for e in all_cases:
        print(e)
        time = order(e)
        print(time)
        if time < min_time:
            min_time = time

    print("---------------")
    print(min_time)


Fixed code:
import sys
import itertools
import math

"""
B - Five Dishes
https://atcoder.jp/contests/abc123/tasks/abc123_b
"""


def order(order_list):
    t1 = math.ceil(order_list[0] / 10) * 10
    t2 = t1 + math.ceil(order_list[1] / 10) * 10
    t3 = t2 + math.ceil(order_list[2] / 10) * 10
    t4 = t3 + math.ceil(order_list[3] / 10) * 10
    t5 = t4 + order_list[4]
    return t5


if __name__ == '__main__':
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())

    all_order = sorted([a, b, c, d, e])

    all_cases = list(itertools.permutations(all_order))

    min_time = sys.maxsize

    for e in all_cases:
        time = order(e)
        if time < min_time:
            min_time = time

    print(min_time)
Buggy code:
import math


def main():
    items = []

    for i in range(5):
        items.append(int(input()))

    maxi = 0
    for i in range(5):
        if items[i] % 10 < items[maxi] % 10 and items[i] % 10 != 0:
            maxi = i

    ret = 0
    for i in range(5):
        if i != maxi:
            if items[i] % 10 != 0:
                ret += int(math.floor(items[i] / 10) + 1) * 10
            else:
                ret += int(math.floor(items[i] / 10)) * 10
            print(items[i], int(math.floor(items[i] / 10) + 1) * 10)
            continue
        ret += items[i]

    print(ret)


main()


Fixed code:
import math


def main():
    items = []

    for i in range(5):
        items.append(int(input()))

    maxi = 0
    for i in range(5):
        if items[i] % 10 < items[maxi] % 10 and items[i] % 10 != 0:
            maxi = i

    ret = 0
    for i in range(5):
        if i != maxi:
            if items[i] % 10 != 0:
                ret += int(math.floor(items[i] / 10) + 1) * 10
            else:
                ret += int(math.floor(items[i] / 10)) * 10
            continue
        ret += items[i]

    print(ret)


main()
Buggy code:
def sub():
    items = [int(input()) for _ in range(5)]
    ms = [e % 10 for e in items]

    minIdx = None
    minMod = 11
    for i, m in enumerate(ms):
        if m == 0:
            continue
        if m < minMod:
            minMod = m
            minIdx = i
    if minIdx is None:
        print(sum(items))
        return
    others = items[:minIdx] + items[minIdx+1:]
    cum = 0
    for a in others:
        m = a % 10
        if m == 0:
            cum = cum + a
        else:
            cum = cum + (10 - m)
    cum = cum + items[minIdx]
    print(cum)

sub()


Fixed code:


def sub():
    items = [int(input()) for _ in range(5)]
    ms = [e % 10 for e in items]

    minIdx = None
    minMod = 11
    for i, m in enumerate(ms):
        if m == 0:
            continue
        if m < minMod:
            minMod = m
            minIdx = i
    if minIdx is None:
        print(sum(items))
        return
    others = items[:minIdx] + items[minIdx+1:]
    cum = 0
    for a in others:
        m = a % 10
        if m == 0:
            cum = cum + a
        else:
            cum = cum + a + (10 - m)
    cum = cum + items[minIdx]
    print(cum)

sub()
Buggy code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

hasuu = [item % 10 if item % 10 != 0 
         for item in [A, B, C, D, E]]

for item in [A, B, C, D, E]:
  if item % 10 == 0:
    result += item 
  else:
    result += (item // 10 + 1) * 10
    
result = int(result - 10 + min(hasuu))
print(result)
    

    

Fixed code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

result = 0

hasuu = [item % 10 for item in [A, B, C, D, E] if item % 10 != 0]

for item in [A, B, C, D, E]:
  if item % 10 == 0:
    result += item 
  else:
    result += (item // 10 + 1) * 10
    
if hasuu != []:
  result = int(result - 10 + min(hasuu))

print(result)
Buggy code:
l = []
for i in range(5):
    l.append(int(input()))

last = min(l,key = lambda x:x%10)
l.remove(last)

sum = 0

for i in l:
    if i%10==0:
        sum+=i
    else:
        sum+=i-1%10+10
        
print(sum+last)



Fixed code:
l = []
for i in range(5):
    l.append(int(input()))

last = min(l,key = lambda x:(x+9)%10)
l.remove(last)

sum = 0
for i in l:
    if i%10==0:
        sum+=i
    else:
        sum+=i-i%10+10
        
print(sum+last)