qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import itertools
costs = [int(x) for x in input().split()]
ans = 1000000000000
for x in itertools.permutations([0, 1, 2, 3, 4]):
  c = 0
  for i in range(0, 5):
    c += costs[x[i]]
    if i != 4 and c % 10 != 0:
      c += 10 - c % 10
  ans = min(c, ans)
print(ans)

Fixed code:
import itertools
costs = [int(input()) for _ in range(0, 5)]
ans = 1000000000000
for x in itertools.permutations([0, 1, 2, 3, 4]):
  c = 0
  for i in range(0, 5):
    c += costs[x[i]]
    if i != 4 and c % 10 != 0:
      c += 10 - c % 10
  ans = min(c, ans)
print(ans)
Buggy code:
a=[]
for i in range(5):
  a.append(int(input()))
a.sort(key=x:lambda (x-1)%10)
b=0
for i in range(5):
  if i==1:
    b+=a[i]
  else:
    c=(a[i]+1)//10+1
    b+=c*10
print(b)

Fixed code:
a=[]
for i in range(5):
  a.append(int(input()))
a.sort(key=lambda x:(x-1)%10)
b=0
for i in range(5):
  if i==0:
    b+=a[i]
  else:
    c=(a[i]-1)//10+1
    b+=c*10
print(b)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

ar = a % 10
mi = ar
br = b % 10
if br > 0 and br < mi:
  mi = br
cr = c % 10
if cr > 0 and cr < mi:
  mi = cr
dr = d % 10
if dr > 0 and dr < mi:
  mi = dr
er = e % 10
if er > 0 and er < mi:
  mi = er

li = [a,b,c,d,e]
su = 0
fl = 0
for i in li:
  if i%10==mi and fl == 0:
#    print("{} += {}".format(su,i))
    su = su + i
    fl = 1
  else:
#    print("{} += {}".format(su,i//10*10+10))
    su = su + i//10*10+10
print(su)


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

mi = 9
ar = a % 10
if ar > 0 and ar < mi:
  mi = ar
br = b % 10
if br > 0 and br < mi:
  mi = br
cr = c % 10
if cr > 0 and cr < mi:
  mi = cr
dr = d % 10
if dr > 0 and dr < mi:
  mi = dr
er = e % 10
if er > 0 and er < mi:
  mi = er

li = [a,b,c,d,e]
su = 0
fl = 0
for i in li:
  if i%10==mi and fl == 0:
#    print("{} += {}".format(su,i))
    su = su + i
    fl = 1
  else:
#    print("{} += {}".format(su,i//10*10+10))
    if i%10 == 0:
      su = su+i
    else:
      su = su + i//10*10+10
print(su)
Buggy code:
import numpy as np
t = [int(input()) for i in range(5)] 
a = np.zeros(5)

for i in range(5):
  a[i] = ( t[i] + 9 ) // 10 * 10 - t[i]

b = 0  
for j in range(1,5):
  if a[0] < a[j]:
    b = j

c = np.zeros(5)
for i in range(5):
  c[i] = ( t[i] + 9 ) // 10 * 10
    
ans = 0     
ans = np.sum(c) + t[b] - c[b]
print(ans)

Fixed code:
import numpy as np
t = [int(input()) for i in range(5)] 
a = np.zeros(5)

for i in range(5):
  a[i] = ( t[i] + 9 ) // 10 * 10 - t[i]
  
b = 0  
for j in range(1,5):
  if a[0] < a[j]:
    b = j
    a[0] = a[b]

c = np.zeros(5)
for i in range(5):
  c[i] = ( t[i] + 9 ) // 10 * 10
    
ans = 0     
ans = np.sum(c) + t[b] - c[b]
print(int(ans))
Buggy code:
from sys import exit
# A,B,C = [int(n) for n in input().split()]
# N = int(input())
A = [0]*5
last = 128

for _ in range(5):
    A[_] = int(input())
    if(A[_]%10 != 0 and last%10 > A[_]%10):
        last = A[_]
ans = 0
once = False
for a in A:
    if(a == last and not once):
        once = True
        continue
    if(a%10 != 0 and a > 9):
        a+=10 - a%10
    ans+=a
if(last == 128):
    print(ans)
else:
    print(ans+last)
# S = str(input())
# L = len(S)
# T = str(input())
# exit()


Fixed code:
from sys import exit
# A,B,C = [int(n) for n in input().split()]
# N = int(input())
A = [0]*5
last = 129

for _ in range(5):
    A[_] = int(input())
    if(A[_]%10 != 0 and last%10 >= A[_]%10):
        last = A[_]
ans = 0
once = False
for a in A:
    if(a == last and not once):
        once = True
        continue
    if(a%10 != 0 ):
        a+=10 - a%10
    ans+=a
if(last == 129):
    print(ans)
else:
    print(ans+last)
# S = str(input())
# L = len(S)
# T = str(input())
# exit()
Buggy code:
dishes = []
for i in range(5):
    tmp = int(input())
    dishes.append([tmp % 10, tmp])
s_dished = sorted(dishes, reverse=True)

time = 0
for idx,item in enumerate(s_dished):
    time += item[1] + 10 - item[0]

time -= 10 - s_dished[4][0]

print(time)



Fixed code:
dishes = []
for i in range(5):
    tmp = int(input())
    rank = 10 if tmp % 10 == 0 else tmp % 10
    dishes.append([rank, tmp])
s_dished = sorted(dishes, reverse=True)

time = 0
for idx,item in enumerate(s_dished):
    time += item[1] + 10 - item[0]

time -= 10 - s_dished[4][0]

print(time)
Buggy code:
time=[]
for i in range(5):
    temp=[]
    temp.append(int(input()))
    if temp[0]%10==0:
        temp.append(0)
    else:
        temp.append(10-temp[0]%10)
    time.append(temp)
print(time)
time=sorted(time,key=lambda x:x[1])
print(time)
sum=0
for i in range(5):
    sum+=time[i][0]
    sum+=time[i][1]
print(sum-time[4][1])

Fixed code:
time=[]
for i in range(5):
    temp=[]
    temp.append(int(input()))
    if temp[0]%10==0:
        temp.append(0)
    else:
        temp.append(10-temp[0]%10)
    time.append(temp)
time=sorted(time,key=lambda x:x[1])
sum=0
for i in range(5):
    sum+=time[i][0]
    sum+=time[i][1]
print(sum-time[4][1])
Buggy code:
a=[int(input()) for i in range(5)]
minn=0
for i in a:
  minn=min(minn,int(i[-1]))
  summ+=(int(i)+9)//10
print(summ+minn)

Fixed code:
a=[int(input()) for i in range(5)]
minn,summ=10,0
for i in a:
  minn=min(minn,(i-1)%10)
  summ+=(i+9)//10
print(summ*10+minn-9)
Buggy code:
def main():
	r = [0]*5
	r[0] = int(input())
	r[1] = int(input())
	r[2] = int(input())
	r[3] = int(input())
	r[4] = int(input())

	total = 0
	mod_min = 10

	for x in r:
		div = x//10
		total += div*10
		mod = x%10
		if mod != 0:
			if mod < mod_min:
				mod_min = mod
			total+=10
		total = total - 10 + mod_min
	print(total)


if __name__ == '__main__':
    main()

Fixed code:
def main():
	r = [0]*5
	r[0] = int(input())
	r[1] = int(input())
	r[2] = int(input())
	r[3] = int(input())
	r[4] = int(input())

	total = 0
	mod_min = 10

	for x in r:
		div = x//10
		total += div*10
		mod = x%10
		if mod != 0:
			if mod < mod_min:
				mod_min = mod
			total+=10
	total = total - 10 + mod_min
	print(total)


if __name__ == '__main__':
    main()
Buggy code:
mino=10
ans=0
for i in range(5):
  x=int(input())
  if x%10==0:
    ans+=x
  else:
    if mino > x%10:
      mino = x%10
      ans+=x+x%10
ans=ans-(10-mino)
print(ans)
  

Fixed code:
mino=10
ans=0
for i in range(5):
  x=int(input())
  if x%10==0:
    ans+=x
  else:
    ans+=x+10-x%10
    if mino > x%10:
      mino = x%10
ans=ans-(10-mino)
print(ans)
Buggy code:
dishes=[]
mindiv=10

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

for j in range(len(dishes)):
  k= dishes[j]
  if(k%10 ==0 ):
    continue
  if(k%10 <mindiv):
    mindiv= k%10
  if(k%10 <5 ):
    k += 5
  dishes[j]= round(k,-1)
  
print(dishes)
print(mindiv)
print(sum(dishes)-(10-mindiv))

Fixed code:
dishes=[]
mindiv=10

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

for j in range(len(dishes)):
  k= dishes[j]
  if(k%10 ==0 ):
    continue
  if(k%10 <mindiv):
    mindiv= k%10
  if(k%10 <=5 ):
    k += 5
  dishes[j]= round(k,-1)
  
# print(dishes)
# print(mindiv)
print(sum(dishes)-(10-mindiv))
Buggy code:
dishes = [int(input()) for _ in range(5)]
dishes = sorted(dishes, key=lambda x: x % 10)
minutes = 0
first = True
for i in dishes:
    if i % 10 == 0:
        minutes += i
    else:
        if first:
            minutes += i
            first = False
        else:
            minutes += int(np.ceil(i/10)*10)
print(minutes)

Fixed code:
import numpy as np
dishes = [int(input()) for _ in range(5)]
dishes = sorted(dishes, key=lambda x: x % 10)
minutes = 0
first = True
for i in dishes:
    if i % 10 == 0:
        minutes += i
    else:
        if first:
            minutes += i
            first = False
        else:
            minutes += int(np.ceil(i/10)*10)
print(minutes)
Buggy code:
import itertools

s = [int(input()) for _ in range(5)]

res = 1 << 28
for ss in itertools.permutations(s):
    tmp = 0
    tmp += (ss[0] + 9) // 10
    tmp += (ss[1] + 9) // 10
    tmp += (ss[2] + 9) // 10
    tmp += (ss[3] + 9) // 10
    tmp += ss[4]
    res = min(res, tmp)

print(res)


Fixed code:
import itertools

s = [int(input()) for _ in range(5)]

res = 1 << 28
for ss in itertools.permutations(s):
    tmp = 0
    tmp += (ss[0] + 9) // 10 * 10
    tmp += (ss[1] + 9) // 10 * 10
    tmp += (ss[2] + 9) // 10 * 10
    tmp += (ss[3] + 9) // 10 * 10
    tmp += ss[4]
    res = min(res, tmp)

print(res)
Buggy code:
t=0
for i in sorted(map(int,set(open(0))),key=lambda x:-x%10-(x%10<1)):t+=i+(10-t)%10
print(t)

Fixed code:
t=0
for i in sorted(map(int,list(open(0))),key=lambda x:-x%10-(x%10<1)):t+=i+(10-t)%10
print(t)
Buggy code:
x,y=[],[]
t=10
for i in range(5):
    x.append(int(input()))
    y.append(x[i]%10)
    if 0<y[i]<t:
        t=y[i]
    if x[i]%10!=0:
        x[i]=((x[i]//10)+1)*10
    y[i]=x[i]

print(x)
print(y)
print(t)
print(sum(y)+t-10)

Fixed code:
x,y=[],[]
t=10
for i in range(5):
    x.append(int(input()))
    y.append(x[i]%10)
    if 0<y[i]<t:
        t=y[i]
    if x[i]%10!=0:
        x[i]=((x[i]//10)+1)*10
    y[i]=x[i]
print(sum(y)+t-10)
Buggy code:
m = 9
l = []
r = []
for i in range(5):
  a = int(input())
  if a % 10 != 0:
    m = 10 - a % 10
    b = a + a % 10
    l.append(b)
    r.append(m)
  else:
    l.append(a)
r.sort()
print(sum(l) - r[-1])
      

Fixed code:
m = 9
l = []
r = []
for i in range(5):
  a = int(input())
  if a % 10 != 0:
    m = 10 - a % 10
    b = a + m
    l.append(b)
    r.append(m)
  else:
    l.append(a)
    r.append(0)
r.sort()
print(sum(l) - r[-1])
Buggy code:
times = [int(input()) for _ in range(5)]
times1 = []
total = 0
for t in times:
  t1 = t % 10
  times1.append(t1)
  if t1 == 0:
    total += t
  else:
    total += (t//10 + 1) * 10
total = total + min(times1) - 10
print(total)

Fixed code:
times = [int(input()) for _ in range(5)]
times1 = []
total = 0
for t in times:
  t1 = t % 10
  if t1 == 0:
    total += t
  else:
    times1.append(t1)
    total += (t//10 + 1) * 10
if len(times1) >= 1:
    total = total + min(times1) - 10
print(total)
Buggy code:
import math
a = []
mini = 9
flag = False
for i in range(5):
    x = int(input())
    if x%10==0:
        a.append(x)
    else:
        flag = True
        if x%10<mini :
            mini = x%10
        a.append(math.ceil(x/10)*10)

if flag:
    print(sum(a)-mini)
else:
    print(sum(a))

Fixed code:
import math
a = []
mini = 9
flag = False
for i in range(5):
    x = int(input())
    if x%10==0:
        a.append(x)
    else:
        flag = True
        if x%10<mini :
            mini = x%10
        a.append(math.ceil(x/10)*10)

if flag:
    print(sum(a)-(10-mini))
else:
    print(sum(a))
Buggy code:
a = []
b = []
for i in range(5):
    n = int(input())
    b.append(n % 10)
    while n % 10 != 0:
        n = n + 1
    a.append(n)

if max(b) == 0:
    print(a[0] + a[1] + a[2] + a[3] + a[4])
else:
    print(a[0] + a[1] + a[2] + a[3] + a[4] - 10 + min(b))

Fixed code:
a = []
b = []
for i in range(5):
    n = int(input())
    if n % 10 == 0:
        b.append(10)
    else:
        b.append(n % 10)
    while n % 10 != 0:
        n = n + 1
    a.append(n)

print(a[0] + a[1] + a[2] + a[3] + a[4] - 10 + min(b))
Buggy code:
lst = [int(input()) for _ in range(5)]

sum = 0
edge = 10

for ele in lst:
    if ele % 10 == 0:
        # do something
        sum += ele
    else:
        sum += ((ele - 1) // 10 + 1) * 10
        edge = min(edge, ele % 10)
print(sum + edge % 10)


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

sum = 0
edge = 10

for ele in lst:
    if ele % 10 == 0:
        # do something
        sum += ele
    else:
        sum += ((ele - 1) // 10 + 1) * 10
        edge = min(edge, ele % 10)

print(sum + edge - 10)
Buggy code:
import sys
import os
import math
import bisect
import collections
import itertools
import heapq

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def f(N):
    return (round(N // 10)+1) * 10


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    ABCDE = itertools.permutations([ii() for _ in range(5)])

    ret = MAX
    for a, b, c, d, e in ABCDE:
        ret = min(ret, f(a) + f(b) + f(c) + f(d) + e)
    print(ret)


if __name__ == '__main__':
    main()


Fixed code:
import sys
import os
import math
import bisect
import collections
import itertools
import heapq

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def f(N):
    return (math.ceil(N / 10)) * 10


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    ABCDE = itertools.permutations([ii() for _ in range(5)])

    ret = MAX
    for a, b, c, d, e in ABCDE:
        ret = min(ret, f(a) + f(b) + f(c) + f(d) + e)
    print(ret)


if __name__ == '__main__':
    main()
Buggy code:
def main():
    A = int(input())
    B = int(input())
    C = int(input())
    D = int(input())
    E = int(input())

    min_mod = 0
    elapsed_time = 0
    for x in [A, B, C, D, E]:
        mod = x % 10
        if 0 < mod < min_mod:
            min_mod = mod
        time = x if x % 10 == 0 else (x // 10 + 1) * 10
        elapsed_time += time

    elapsed_time = elapsed_time - (10 - min_mod) if min_mod != 0 else elapsed_time
    print(elapsed_time)

if __name__ == '__main__':
    main()

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

    min_mod = 10
    elapsed_time = 0
    for x in [A, B, C, D, E]:
        mod = x % 10
        if 0 < mod < min_mod:
            min_mod = mod
        time = x if x % 10 == 0 else (x // 10 + 1) * 10
        elapsed_time += time

    elapsed_time = elapsed_time - (10 - min_mod)
    print(elapsed_time)

if __name__ == '__main__':
    main()
Buggy code:
a = []
for i in range(5):
    a.append(int(input()))
 
b = []
c = []
for j in range(5):
    if a[j] % 10 == 0:
        c.append(10)
        b.append(a[j]-10)
    else:
      　num = a[j]%10
        c.append(num)
        b.append(a[j] - c[j])
        
 
b_sum = sum(b)
c_min = min(c)
c_sum = c_min + 4*10
 
print(b_sum + c_sum)

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

b = []
c = []
for j in range(5):
    if a[j] % 10 == 0:
        c.append(10)
        b.append(a[j]-10)
    else:
        c.append(a[j] % 10)
        b.append(a[j] - c[j])
        

b_sum = sum(b)
c_min = min(c)
c_sum = c_min + 4*10

print(b_sum + c_sum)
Buggy code:
order = [int(input()) for _ in range(5)]
min_digit = 0
time = 9
for i in range(len(order)):
  digit = order[i]%10
  if min_digit>=digit and digit!=0:
    min_digit=digit
for i in range(len(order)):
  if order[i]%10!=0:
    time+=(order[i]//10+1)*10
  else:
    time+=order[i]
print (time-(10-min_digit))

Fixed code:
order = [int(input()) for _ in range(5)]
min_digit = 9
time = 0
for i in range(len(order)):
  if order[i]%10!=0:
    time+=(order[i]//10+1)*10
  else:
    time+=order[i]

for i in range(len(order)):
  digit = order[i]%10
  if min_digit>=digit and digit!=0:
    min_digit=digit
    
order_digit = [i%10 for i in order]
if order_digit == [0,0,0,0,0]:
  print (time)
else:
  print (time-10+min_digit)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

ra = math.ceil(a / 10) * 10 - a
rb = math.ceil(b / 10) * 10 - b
rc = math.ceil(c / 10) * 10 - c
rd = math.ceil(d / 10) * 10 - d
re = math.ceil(e / 10) * 10 - e

ans = a + b + c + d + e + ra + rb + rc + rd + re - max(ra, rb, rc, rd, re)

print(ans)

Fixed code:
import math

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

ra = math.ceil(a / 10) * 10 - a
rb = math.ceil(b / 10) * 10 - b
rc = math.ceil(c / 10) * 10 - c
rd = math.ceil(d / 10) * 10 - d
re = math.ceil(e / 10) * 10 - e

ans = a + b + c + d + e + ra + rb + rc + rd + re - max(ra, rb, rc, rd, re)

print(ans)
Buggy code:
# coding: utf-8

import sys
input = sys.stdin.readline

times = []
for _ in range(5):
    x = int(input())
    times.append([x, ((x + 9) // 10 * 10) - x])

times.sort(key=lambda x : x[1])

ans = 0
for i in range(4):
    ans += times[i][0] + times[i][1]

ans += times[-1][0]

print(times)
print(ans)



Fixed code:
# coding: utf-8

import sys
input = sys.stdin.readline

times = []
for _ in range(5):
    x = int(input())
    times.append([x, ((x + 9) // 10 * 10) - x])

times.sort(key=lambda x : x[1])

ans = 0
for i in range(4):
    ans += times[i][0] + times[i][1]

ans += times[-1][0]

print(ans)
Buggy code:
def mi(): return map(int,input().split())
def lmi(): return list(map(int,input().split()))
def ii(): return int(input())
def isp(): return input().split()

a=[]
r=[]
for i in range(5):
  s=ii()
  a.append(s)
  r_=s%10
  r.append(r_)
  
ans=0
while len(r)>1:
  k=r.index(max(r))
  remain=r.pop(k)
  A=a.pop(k)
  #print(A)
  ans+=A-remain+10
  
print(ans+a[0])

Fixed code:
def mi(): return map(int,input().split())
def lmi(): return list(map(int,input().split()))
def ii(): return int(input())
def isp(): return input().split()

a=[]
r=[]
for i in range(5):
  s=ii()
  a.append(s)
  r_=s%10
  if r_==0:
    r_=10
  r.append(r_)
  
ans=0
while len(r)>1:
  k=r.index(max(r))
  remain=r.pop(k)
  A=a.pop(k)
  #print(A)
  ans+=A-remain+10
  
print(ans+a[0])
Buggy code:
a=map(int,open(0));print(min(~-i%10for i in a)-sum(-i//10*10for i in a)-9)

Fixed code:
*a,=map(int,open(0));print(min(~-i%10for i in a)-sum(-i//10*10for i in a)-9)
Buggy code:
a=eval('int(input()),'*5);print(min(i%10for i in a)-9-sum(-i//10*10for i in a))

Fixed code:
a=eval('int(input())-1,'*5);print(min(i%10for i in a)+sum((i//10+1)*10for i in a)-9)
Buggy code:
e,*a=sorted(eval('int(input()),'*5),key=lambda x:~x%10);print(e-sum(-i//10*10for i in a))

Fixed code:
e,*a=sorted(eval('int(input()),'*5),key=lambda x:(x%10-1)%10);print(e-sum(-i//10*10for i in a))
Buggy code:
l = [int(input()) for i in range(5)]
mod = [l[i] % 10 for i in range(5)]
print(mod)
time = 0
if max(mod) == 0:
    print(sum(l))
else:
    min = 0
    for i in range(5):
        if mod[i] != 0:
            time += l[i] + (10 - mod[i])
            if min < 10 - mod[i]:
                min = 10 - mod[i]
        else:
            time += l[i]
    print(time - min)

Fixed code:
l = [int(input()) for i in range(5)]
mod = [l[i] % 10 for i in range(5)]
time = 0
if max(mod) == 0:
    print(sum(l))
else:
    min = 0
    for i in range(5):
        if mod[i] != 0:
            time += l[i] + (10 - mod[i])
            if min < 10 - mod[i]:
                min = 10 - mod[i]
        else:
            time += l[i]
    print(time - min)
Buggy code:
time = []
for i in range(5):
  time.append(int(input()))
  
time_diff = [10-(i%10) for i in time]
time_ten = [i+10-i%10 for i in time]

max_diff = time_diff.index(max(time_diff))

ans = sum(time_ten) - time_ten[max_diff] + time[max_diff]

print(ans)

Fixed code:
time = []
for i in range(5):
  time.append(int(input()))
  
time_diff = [(10-(i%10))%10 for i in time]
time_ten = [i+(10-i%10)%10 for i in time]


max_diff = time_diff.index(max(time_diff))

ans = sum(time_ten) - time_ten[max_diff] + time[max_diff]

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

ans=0
rowMin=0

for item in r:
  ans+=(((-1*item)//10)*(-10))
  if item%10 !=0 and item%10<rowMin%10:
    rowMin=item
    

ans=ans+rowMin-(((-1*rowMin)//10)*(-10))
print(ans)

Fixed code:
r=[int(input()) for _ in range(5)]
#print(r)

ans=0
rowMin=9

flag=0
for item in r:
  ans+=(((-1*item)//10)*(-10))
  if item%10 !=0 and item%10<=rowMin%10:
    rowMin=item
    flag=1
if flag==1:
  ans=ans+rowMin-(((-1*rowMin)//10)*(-10))
else:
  ans=ans
print(ans)
Buggy code:
a=input()
b=input()
c=input()
d=input()
e=input()
T=[a,b,c,d,e]
A=list(map(lambda x:x%10,T))
S=list(map(lambda y:y//10,T))
count=0
B=[]
for j in range(5):
    if A[j]!=0:
        count+=1
        B.append(A[j])
print(10*(sum(S)+count-1)+min(B))

Fixed code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
T=[a,b,c,d,e]
A=list(map(lambda x:x%10,T))
S=list(map(lambda y:y//10,T))
count=0
B=[]
for j in range(5):
    if A[j]!=0:
        count+=1
        B.append(A[j])
if len(B)==0:
    print(10*(sum(S)+count))
else:
    print(10*(sum(S)+count-1)+min(B))
Buggy code:
dish = []
for i in range(5):
    dish.append(int(input()))
ichi = 0
for i in range(1,5):
    if dish[i]%10 > 0 and dish[ichi] % 10 > dish[i] % 10:
        ichi = i
print(str(ichi))
for i in range(5):
    if i != ichi and dish[i]%10 > 0:
        dish[i] += 10 - dish[i]%10
print(sum(dish))

Fixed code:
dish = []
for i in range(5):
    dish.append(int(input()))
ichi = 0
for i in range(1,5):
    if dish[i]%10 > 0 and dish[ichi] % 10 > dish[i] % 10:
        ichi = i
for i in range(5):
    if i != ichi and dish[i]%10 > 0:
        dish[i] += 10 - dish[i]%10
print(sum(dish))
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
def f(x):
  return -(-x // 10) * 10
def g(x):
  return x % 10
ans = sum(f(i) for i in [a,b,c,d,e])
ans += min(g(i) for i in [a,b,c,d,e])

Fixed code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
def f(x):
  return -(-x // 10) * 10
def g(x):
  return (x-1) % 10 + 1
ans = sum(f(i) for i in [a,b,c,d,e])
mi = min(g(i) for i in [a,b,c,d,e])
ans += mi - 10
print(ans)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

sec_time = {}
sec_time[A] = A % 10 if A % 10 != 0 else 10
sec_time[B] = B % 10 if B % 10 != 0 else 10
sec_time[C] = C % 10 if C % 10 != 0 else 10
sec_time[D] = D % 10 if D % 10 != 0 else 10
sec_time[E] = E % 10 if E % 10 != 0 else 10

sorted_sec_time = sorted(sec_time.items(), key=lambda x:x[1], reverse=True) 

result = 0
i = 0
for time in sorted_sec_time:
    result += time[0]
    i += 1
    if result % 10 != 0 and i != 5:
        result += 10 - result % 10
    
print(result)

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

sec_time = {}
sec_time["A"] = A, A % 10 if A % 10 != 0 else 10
sec_time["B"] = B, B % 10 if B % 10 != 0 else 10
sec_time["C"] = C, C % 10 if C % 10 != 0 else 10
sec_time["D"] = D, D % 10 if D % 10 != 0 else 10
sec_time["E"] = E, E % 10 if E % 10 != 0 else 10

sorted_sec_time = sorted(sec_time.items(), key=lambda x:x[1][1], reverse=True) 

result = 0
i = 0
for time in sorted_sec_time:
    result += time[1][0]
    i += 1
    if result % 10 != 0 and i != 5:
        result += 10 - result % 10
    
print(result)
Buggy code:
dishes = [input() for i in range(5)]

sum_time = 0
last_order_surplus = 10

for dish in dishes:
  if last_order_surplus > int(dish) % 10 & int(dish) % 10 != 0:
    last_order_surplus = int(dish) % 10
  if int(dish) % 10 != 0:
    sum_time += int(int(dish) / 10 + 1)
  else:
    sum_time = int(int(dish) / 10)

print (sum_time * 10 + last_order_surplus - 10)

Fixed code:
dishes = [input() for i in range(5)]

sum_time = 0
last_order_surplus = 10

for dish in dishes:
  if last_order_surplus > int(dish) % 10 & int(dish) % 10 != 0:
    last_order_surplus = int(dish) % 10
  if int(dish) % 10 != 0:
    sum_time += int(int(dish) / 10 + 1)
  else:
    sum_time += int(int(dish) / 10)

print (sum_time * 10 + last_order_surplus - 10)