Problem:


Score: 200 points

Problem Statement

The restaurant AtCoder serves the following five dishes:

ABC Don (rice bowl): takes A minutes to serve.

ARC Curry: takes B minutes to serve.

AGC Pasta: takes C minutes to serve.

APC Ramen: takes D minutes to serve.

ATC Hanbagu (hamburger patty): takes E minutes to serve.

Here, the time to serve a dish is the time between when an order is placed and when the dish is delivered.

This restaurant has the following rules on orders:

An order can only be placed at a time that is a multiple of 10 (time 0, 10, 20, ...).

Only one dish can be ordered at a time.

No new order can be placed when an order is already placed and the dish is still not delivered, but a new order can be placed at the exact time when the dish is delivered.

E869120 arrives at this restaurant at time 0. He will order all five dishes. Find the earliest possible time for the last dish to be delivered.

Here, he can order the dishes in any order he likes, and he can place an order already at time 0.

Constraints

A, B, C, D and E are integers between 1 and 123 (inclusive).

Input

Input is given from Standard Input in the following format:

A
B
C
D
E

Output

Print the earliest possible time for the last dish to be delivered, as an integer.

Sample Input 1

29
20
7
35
120

Sample Output 1

215

If we decide to order the dishes in the order ABC Don, ARC Curry, AGC Pasta, ATC Hanbagu, APC Ramen, the earliest possible time for each order is as follows:

Order ABC Don at time 0, which will be delivered at time 29.

Order ARC Curry at time 30, which will be delivered at time 50.

Order AGC Pasta at time 50, which will be delivered at time 57.

Order ATC Hanbagu at time 60, which will be delivered at time 180.

Order APC Ramen at time 180, which will be delivered at time 215.

There is no way to order the dishes in which the last dish will be delivered earlier than this.

Sample Input 2

101
86
119
108
57

Sample Output 2

481

If we decide to order the dishes in the order AGC Pasta, ARC Curry, ATC Hanbagu, APC Ramen, ABC Don, the earliest possible time for each order is as follows:

Order AGC Pasta at time 0, which will be delivered at time 119.

Order ARC Curry at time 120, which will be delivered at time 206.

Order ATC Hanbagu at time 210, which will be delivered at time 267.

Order APC Ramen at time 270, which will be delivered at time 378.

Order ABC Don at time 380, which will be delivered at time 481.

There is no way to order the dishes in which the last dish will be delivered earlier than this.

Sample Input 3

123
123
123
123
123

Sample Output 3

643

This is the largest valid case.



Sample input:
29
20
7
35
120


Sample output:
215

Submission status: Runtime Error

Solution code:
sum=0
for i in range(5):
  y=int(input())
  x=10-y%10
  min=min(10, x)
  if x==min:
    sum+=y
  else:
    sum+=y+x
print(sum)

Submission status: Runtime Error

Solution code:
sum=0
for i in range(5):
  y=int(input())
  x=10-y%10
  min=min(min, 10)
  if x=min:
    sum+=y
  else:
    sum+=y+x
print(sum)

Submission status: Runtime Error

Solution code:
x=10
sum=0
for i in range(5):
  y=int(input())
  x=10-y%10
  min=min(min, x)
  if x=min:
    sum+=y
  else:
    sum+=y+x
print(sum)

Submission status: Runtime Error

Solution code:
import math
a,b,c,d,e=(i for i in input())

last=int(min(a[-1],b[-1],c[-1],d[-1],e[-1]))
a,b,c,d,e=map(int,a,b,c,d,e)
ans=list(map(lambda x:(math.ceil(x/10))*10, a,b,c,d,e if != last)
print(sum(ans)+last)
#abcdeの一桁目の最小をlastに入れてlast以外の数字を１０の倍数にして
#その合計とlastを足したものが答え

Submission status: Runtime Error

Solution code:
import math
a,b,c,d,e=(i for i in input())

last=int(min(a[-1],b[-1],c[-1],d[-1],e[-1]))
a,b,c,d,e=map(int,a,b,c,d,e)
ans=list(map(lambda x:(math.ceil(x/10))*10, a,b,c,d,e if != last)
print(sum(ans)+last)

Submission status: Runtime Error

Solution code:
import math

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
sub = min(m % 10 for m in [a,b,c,d,e] if m % 10 != 0)
time = 10 * (math.ceil(a / 10) + math.ceil(b / 10)+ math.ceil(c / 10)+ math.ceil(d / 10)+ math.ceil(e / 10)) - (10 - sub)
print(int(time))

Submission status: Runtime Error

Solution code:
import math

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
sub = miin(m % 10 for m in [a,b,c,d,e] if m % 10 != 0)
time = 10 * (ceil(a / 10) + ceil(b / 10)+ ceil(c / 10)+ ceil(d / 10)+ ceil(e / 10)) - (10 - sub)
print(int(time))

Submission status: Runtime Error

Solution code:
import math

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
sub = miin(m % 10 for m in [a,b,c,d,e] if m % 10 != 0)
time = 10 * (ciel(a / 10) + ciel(b / 10)+ ciel(c / 10)+ ciel(d / 10)+ ciel(e / 10)) - (10 - sub)
print(time)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
sub = miin(m % 10 for m in [a,b,c,d,e] if m % 10 != 0)
time = 10 * (ciel(a / 10) + ciel(b / 10)+ ciel(b / 10)+ ciel(b / 10)+ ciel(b / 10)) - (10 - sub)
print(time)

Submission status: Runtime Error

Solution code:
l = []
l1 = []
for i in range(5):
  a = int(input())
  l.append((a,a%10))
l.sort(key = lambda x: x[1])

count = 0
for i in range(5):
  if l[i][1] == 0:
    count += l[i][0]
  else:
    c = i
    break
for i in range(4,c-1,-1):
  
  if i == c:
    count += l[i][0]
  else:
    count += l[i][0] + 10-l[i][1]
print(count)

Submission status: Runtime Error

Solution code:
dishes = []
for i in range(5):
    dishes.append(input())
    
idx = 0
min_ones_place = 9

for j in range(5):
    ones_place = int(dishes[j][-1])
    if ones_place != 0:
        if ones_place < min_ones_place:
            min_ones_place = ones_place
            idx = j
            
last_dish = int(dishes.pop(idx))

total_time = 0
for k in range(4):
    total_time += int(dishes[k])
    if total_time % 10 == 0:
        pass
    else :
        total_time = int(Decimal(str(total_time)).quantize(Decimal('1E1'), rounding=ROUND_UP))

total_time += last_dish
print(total_time)

Submission status: Runtime Error

Solution code:
dishes = [int(input()) for _ in range(5)]

dishes = sorted(dishes, key=lambda x: 10 - int(str(x)[-1]))
a = list()
b = list()
for d in dishes:
    if d % 10 == 0:
        a.append(d)
    else:
        b.append(d)
b = [d + 10 - d % 10 for d in b[:-1]] + [b[-1]]
dishes = a + b
# print(sum(dishes))
#
print(1)

Submission status: Runtime Error

Solution code:
dishes = [int(input()) for _ in range(5)]

dishes = sorted(dishes, key=lambda x: 10 - int(str(x)[-1]))
a = list()
b = list()
for d in dishes:
    if d % 10 == 0:
        a.append(d)
    else:
        b.append(d)
b = [d + 10 - d % 10 for d in b[:-1]] + [b[-1]]
dishes = a + b
print(sum(dishes))

Submission status: Runtime Error

Solution code:
dishes = [int(input()) for _ in range(5)]

dishes = sorted(dishes, key=lambda x: 10 - int(str(x)[-1]))
a = list()
b = list()
for d in dishes:
    if d % 10 == 0:
        a.append(d)
    else:
        b.append(d)
b = [dish + 10 - dish % 10 for dish in b[:-1]] + [b[-1]]
dishes = a + b
print(sum(dishes))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

ans = 0
tmp = [A, B, C, D, E]
Y = []
Z = []
for i in range(5):
    Y.append([tmp[i] % 10, tmp[i]])
Y.sort()
#print(Y)
for i in range(5):
    if Y[i][0] != 0:
        Z.append(i)
for i in range(5):
    X = Y[i][1]
    #print(i)
    while X % 10 != 0:
        X += 1
    ans += X
    #print(X)
    #print(ans)
G = Y[Z[0]][1]
while G % 10 != 0:
    G += 1
ans -= G
ans += Y[Z[0]][1]
#print(tmp[0])
print(ans)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

ans = 0
tmp = [A, B, C, D, E]
Y = []
Z = []
L = []
for i in range(5):
    Y.append([tmp[i] % 10, tmp[i]])
Y.sort()
#print(Y)
for i in range(5):
    if Y[i][0] != 0:
        Z.append(i)
    else:
        L.append(i)
for i in range(5):
    X = Y[i][1]
    #print(i)
    while X % 10 != 0:
        X += 1
    ans += X
    #print(X)
    #print(ans)
G = Y[Z[0]][1]
while G % 10 != 0:
    G += 1
ans -= G
ans += Y[Z[0]][1]
#print(tmp[0])
print(ans)

Submission status: Runtime Error

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

data_list = [A,B,C,D,E]
last_tmp = 10
last = 0
for data in data_list:
    data_str = str(data)
    if int(data_str[len(data_str)-1]) != 0:
        if last_tmp >= int(data_str[len(data_str)-1]):
            last = data
            last_tmp = int(data_str[len(data_str)-1])

data_list.remove(last)
ans = last
for data in data_list:
    ans += data
    data_str = str(data)
    if int(data_str[len(data_str)-1]) != 0:
        ans += 10-int(data_str[len(data_str)-1])

print(ans)

Submission status: Runtime Error

Solution code:
a=[]
b=[]
for i in range(5):
    x=int(input())
    a.append(x)
    if x%10!=0:
        b.append(10-x%10)
b.sort()
print(sum(a)+sum(b)-max(b))

Submission status: Runtime Error

Solution code:
import math
arr=[]
for _ in range(5):
    arr.append(int(input()))

minnum=10
for num,i in enumerate(arr):
    if int(str(i)[-1])<minnum and int(str(i)[-1])>0:
        minnum=int(str(i)[-1])
        targetnum=num

result=0
for num,i in enumerate(arr):
    if num==targetnum:
        result+=i
        #print("aa")
    else:
        result+=math.ceil(i/10)*10


print(result)

Submission status: Runtime Error

Solution code:
a = [int(input()) for _ in range(5)]
delta = []
time = 0

for i in range(5):
    a10 = 0
    if str(a[i])[-1] != '0':
        a10 = (10 - int(str(a[i])[-1]))
        delta.append(a10)
    time += a[i] + a10


print(time-max(delta))

Submission status: Runtime Error

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

lst1 = []
min1 = 9
num1 = 5

for i, l in enumerate(lst):
    lst1.append(math.ceil(l/10)*10)
    if min1 > l%10 and l%10!=0:
        min1 = l%10
        num1 = i
lst1[num1] = lst[num1]

print(sum(lst1))

Submission status: Runtime Error

Solution code:
n=int(input())
ss=n
l=[]
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
t=0
bb,cc,dd,ee,ff=0,0,0,0,0
while ff==0:
    if ee>0:
        ff+=min(ee,e)
        ee-=min(ee,e)
    if dd>0:
        ee+=min(dd,d)
        dd-=min(dd,d)
    if cc>0:
        dd+=min(cc,c)
        cc-=min(cc,c)
    if bb>0:
        cc+=min(bb,b)
        bb-=min(bb,b)
    if n>0:
        bb+=min(n,a)
        n-=min(n,a)
    t+=1
if ss==ff:
    print(t)
else:
    print(ss//ff+t)

Submission status: Runtime Error

Solution 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)

Submission status: Runtime Error

Solution 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 && c % 10 != 0:
      c += 10 - c % 10
  ans = min(c, ans)
print(ans)

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
li = [[0]*2 for _ in range(5)]
count = 0
total = 0
for i in range(5):
    li[i][0] = int(input())
    li[i][1] = li[i][0]%10
    if li[i][1] == 0:
        count += 1
li.sort(key=lambda x:x[1])
for i in range(count):
    total += li[0][0]
    li = li[1:]
for i in range(5-count-1):
    total += (li[-1][0]+10-li[-1][1])
    li = li[:-1]
print(total+li[0][0])

Submission status: Runtime Error

Solution code:
a

Submission status: Runtime Error

Solution code:
lis=[]
for i in range(5):
    x=int(input())
    lis.append([x%10,x])
lis.sort()
t=0
for i in range(4):
    t+=lis[i,1]+10-lis[i,0]
print(t+lis[4,1])

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
x=[(i,i%10) for i in [a,b,c,d,e] if i%10!=0]
y=[i for i in [a,b,c,d,e] if i%10==0]
x=sorted(x,key=lambda x:x[1])
ans = sum(y)
ans += sum((i[0]//10+1)*10 for i in x[1:])
ans+=x[0][0]
print(ans)

Submission status: Runtime Error

Solution code:
dishes = [int(input()) for _ in range(5)]
print(sum(map(lambda num: num + 10 * (num % 10 != 0) - (num % 10), dishes)) + min(n for n in map(lambda num: num % 10, dishes) if n) - 10)

Submission status: Runtime Error

Solution code:
a = [int(input()) for i in range(5)]
A = min([j%10 for j in a if j%10 != 0])
b = sum([((k//10)+1)*10 for k in a if k%10 != 0])
b += sum([l for l in a if l%10 ==0])
print(b-(10-A))

Submission status: Runtime Error

Solution code:
a=int(input())
p=a%10
b=int(input())
q=b%10
c=int(input())
r=c%10
d=int(input())
s=d%10
e=int(input())
t=e%10
l=[a,b,c,d,e]
m=[p,q,r,s,t]
ans=0
minimum=min(list(set(m)-set([0])))
def func(n):
    if n%10==0:
        return n
    else:
        return (n//10)*10+10
for i in range(5):
    ans+=func(l[i])
ans=ans-10+minimum
print(ans)

Submission status: Runtime Error

Solution code:
A=int(input())
a=A%10
B=int(input())
b=B%10
C=int(input())
c=C%10
D=int(input())
d=D%10
E=int(input())
e=E%10
if a=b=c=d=e=0:
  print(A-a+B-b+C-c+D-d+E-e+4*10-10*[a,b,c,d,e].count(0))
else:
  print(A-a+B-b+C-c+D-d+E-e+4*10+min(set([a,b,c,d,e])-set([0]))-10*[a,b,c,d,e].count(0))

Submission status: Runtime Error

Solution code:
A=int(input())
a=A%10
B=int(input())
b=B%10
C=int(input())
c=C%10
D=int(input())
d=D%10
E=int(input())
e=E%10
print(A-a+B-b+C-c+D-d+E-e+4*10+min(set([a,b,c,d,e])-set([0]))-10*[a,b,c,d,e].count(0))

Submission status: Runtime Error

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

x =[]
j=[]
for i in l:
    t = i%10
    if t != 0:
        x.append(t)
        j.append(i+10-t)
    else:
        j.append(i)

print(sum(j)-10+min(x))

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
p = [a, b, c, d, e]

mi = [a%10,b%10,c%10,d%10,e%10]
mm = [i for i in mi if i != 0]
mm.sort()
sum = 0
for i in range(5):
	if p[i]%10 != 0:
		sum += (p[i]//10+1)*10
	else:
		sum += p[i]//10*10
sum -= 10 - mm[0]
print (sum)

Submission status: Runtime Error

Solution code:
import sys
import math
import numpy as np

def main():
    dish = np.array(sys.stdin.read().split())

    minute = [int(dish[i][-1]) for i in range(5)]
    m = min(x for x in minute if x > 0) if 0 in minute else 10

    res = (np.ceil(dish.astype(np.int64) / 10) * 10).sum() - 10 + m

    print(int(res))

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import sys
import math
import numpy as np

def main():
    dish = np.array(sys.stdin.read().split())

    minute = [int(dish[i][-1]) for i in range(5) ]
    m = min(x for x in minute if x > 0)

    res = (np.ceil(dish.astype(np.int64) / 10) * 10).sum() - 10 + m

    print(int(res))

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
five_dish = [int(input()) for _ in range(5)]
idx = None
maxdiff = 0
result = 0
for i in range(len(five_dish)):
    tmp = five_dish[i] % 10
    if tmp == 0:
        pass
    else:
        if 10 - tmp > maxdiff:
            maxdiff = 10 - tmp
            idx = i
        else:
            pass
for j in range(len(five_dish)):
    if j == idx:
        pass
    else:
        if five_dish[j] % 10 == 0:
            result += five_dish[j]
        else:
            result += five_dish[j] + (10 - (five_dish[j] % 10))
result += five_dish[idx]
print(result)

Submission status: Runtime Error

Solution code:
five_dish = [int(input()) for _ in range(5)]
idx = None
maxdiff = 0
result = 0
for i in range(len(five_dish)):
    tmp = five_dish[i] % 10
    if tmp == 0:
        continue
    else:
        if 10 - tmp >= maxdiff:
            maxdiff = 10 - tmp
            idx = i
        else:
            continue
for j in range(len(five_dish)):
    if j == idx:
        continue
    else:
        if five_dish[j] % 10 == 0:
            result += five_dish[j]
        else:
            result += five_dish[j] + (10 - five_dish[j] % 10)
result += five_dish[idx]
print(result)

Submission status: Runtime Error

Solution code:
dish = [0]*5
dish = [list(input()) for i in range(len(dish))]
time = 0
sumtime = 0

dish_sort = sorted(dish, key=lambda x:x[-1])
dish_sort = [''.join(dish_sort[i]) for i in range(len(dish))]
dish_sort1 = [int(i) for i in dish_sort]
dish_sort2 = [i for i in dish_sort1 if not i%10==0]
dish_sort1.remove(dish_sort2[0])

for i in range(len(dish)-1):
    while dish_sort1[i] > time:
        time += 10
    sumtime += time
    time = 0
print(sumtime+dish_sort2[0])

Submission status: Runtime Error

Solution code:
import math

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

li = [a, b, c, d, e]
idx = sorted([*map(lambda x: [x, x[1] + 10] if x[1] == 0 else x, [[0, (a % 10)], [1, (b % 10)], [2, (c % 10)], [3, (d % 10)], [4, (\
e % 10)]])], key=lambda x: x[1])[0][0]
print(sum(map(lambda x: li[x] if x == idx else math.ceil(li[x] * 0.1) * 10, [0, 1, 2, 3, 4])))

Submission status: Runtime Error

Solution code:
#--import&define---------------------
import math

def yes():
    print("Yes")
def no():
    print("No")
#--my_library--------------------------------
#mapを利用した入力
# x,y = map(int,input().split())

#forを利用した入力
#l = []
#for i in range():
#    l.append(int(input()))

#intの最大値
#x = 2147483647
#--以下解答---------------------------------
l = []
ansL = []
x = 2147483647
index = 0
for i in range(5):
   l.append( int(input()) )
   ansL.append( int(l[i]%10) )
   if ansL[i]>0 and ansL[i]<x:
      index = i

print(l)
ans = 0
for i in range(5):
    if i == dex:
        ans += l[i]
    elif l[i]%10 != 0:
        ans += int(l[i]/10)*10 +10
    else:
        ans += l[i]
    print(ans)

print(ans)

Submission status: Runtime Error

Solution code:
l=[input() for _ in range(5)]
l_1=[]
for i in l:
  if i%10!=0:
    l_1.append(((i+9)//10)*10)
  else:l_1.append(i)
nnn=9999999    
for i in range(5):
  num_1=0
  for j in range(5):
    if i==j:
      num_1+=l[j]
    else:num_1+=l_1[j]
  nnn=min(nnn,num_1)
print(nnn)

Submission status: Runtime Error

Solution code:
# 2019-11-12 22:40:44(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import numpy as np 

def main():
    dishes = [int(x) for x in sys.stdin.read().split()]
    min_first_digit = min(dishes[i] % 10 for i in range(5) if dishes[i] % 10 != 0) | 0

    total = 0
    for i in range(5):
        if dishes[i] % 10 != 0:
            total += (dishes[i] // 10 + 1) * 10
        else:
            total += dishes[i]
    
    ans = total - (10 - min_first_digit)
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution 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)

Submission status: Runtime Error

Solution code:
List= [int(input()) for i in range(5)]
amari =9
time = 0
flag = False;
for i in List:
    if(i%10 != 0):
        time += 10 - i%10
        amari = min(amari,i%10)
        flag = True
output = sum(List) + time
if(flag = True):
    output += amari
print(output)

Submission status: Runtime Error

Solution code:
b=10
d=[]
ans=[]
for i in range(5):
  a=int(input())
  d.append(a)
  if b>a%10 and a%10!=0:
    b=a%10
    k=i
  if a%10==0:
    ans.append(a)
  else:
    ans.append((a//10+1)*10)
ans[k]=d[k]
print(sum(ans))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
T = np.zeros(5, dtype=int)
T[0] = int(input())
T[1] = int(input())
T[2] = int(input())
T[3] = int(input())
T[4] = int(input())
res = np.argsort(T%10)
for i in range(5):
  if(T[res[i]]%10 > 0):
    selected_index = res[i]
    break
tim = (T//10 + (T%10 != 0))*10
tim[selected_index] = T[selected_index]
print(sum(tim))

Submission status: Runtime Error

Solution code:
l=[int(input()) for i in range(5)]
ans=[]
ans1=[]
for i in l:
    if i%10==0:
        ans+=[i]
    else:
        ans1+=[i]
ans2=[]
amari=[]
for i in ans1:
    amari+=[i%10]
    i=((i//10)+1)*10
    ans2+=[i]

amari.sort()
print(sum(ans+ans2)-(10-amari[0]))

Submission status: Runtime Error

Solution code:
li = list()
li2 = list()
for _ in range(5):
    tmp = int(input())
    if(tmp % 10 == 0):
        li2.append(tmp)
    else:
        li.append(tmp)
li.sort(key=lambda x: x % 10, reverse=True)
li2.sort()
ans = sum(li2)
for i in range(len(li)-1):
    ans = ans + ((li[i] // 10 + 1) * 10)
ans += li[-1]
print(ans)

Submission status: Runtime Error

Solution code:
l = [int(input()) for i in range(5)]

result = 9
sum = 0
for i in range(5):
  if l[i] % 10 < result and l[i] % 10 != 0:
    num = i
    result = l[i] % 10

finalMenuNumber = l.pop(num)

for i in range(4):
  if l[i] % 10 == 0:
    sum += l[i]
  else:
    sum += ((l[i]//10)+1)*10

print(sum+finalMenuNumber)

Submission status: Runtime Error

Solution code:
import math
t = []
for i in range(5):
  t.append(int(input()))
ct = [math.ceil(x/10)*10 for x in t]
fraction = [x%10 for x in t]
min_fraction = min(list(filter(lambda x: x > 0, fraction)))
print(sum(ct) - 10 + min_fraction)

Submission status: Runtime Error

Solution code:
list_str = []
list1 = []
for i in range(5):
	a = input()
	list_str.append(list(a))
	list1.append(int(a))


abs_max = 10
count = 0
for i in range(5):
	if int(list_str[i][-1]) != 0 and int(list_str[i][-1]) < abs_max:
		abs_max = int(list_str[i][-1])
for i in range(5):
	count += math.ceil(list1[i]/10)

if abs_max == 10:
	print(int(count*10))
else:
	print(int(count*10)-10+abs_max)

Submission status: Runtime Error

Solution code:
l=[]
total=0
for i in range(5):
    t=int(input())
    if t%10 == 0:
        total +=t
    else:    
        total +=(t//10+1)*10
        b=(t//10+1)*10-t
        l.append(b)
a=max(l)
print(total-a)

Submission status: Runtime Error

Solution code:
l=[]
total=0
for i in range(5):
    t=int(input())
    if t%10 == 0:
        total +=t
    else:    
        total +=(t//10+1)*10
        l.append((t//10+1)*10-t)
a=max(l)
print(total-a)

Submission status: Runtime Error

Solution code:
l=[]
total=0
for i in range(5):
    t=int(input())
    if t%10 !=0:
        total +=(t+9)//10*10
        l.append((t+9)//10*10-t)
    else:
        total +=t
a=max(l)
print(total-a)

Submission status: Runtime Error

Solution code:
l=[]
max=0
total=0
for i in range(5):
    t=int(input())
    if t%10 !=0:
        total +=((t//10)+1)*10
        l.append(t)
    else:
        total +=t
a=min(l,key=lambda x:x%10)

print(total-(10-a%10))

Submission status: Runtime Error

Solution code:
import math
L = [input() for _ in range(5)]
lm = 10
v = 0
for l in L:
  if int(l[-1])<lm and l[-1]!='0':
    lm = int(l[-1])
    v = int(l)
t = 0
L.remove(str(v))
for l in L:
  t += math.ceil(int(l)/10)*10
print(t + v)

Submission status: Runtime Error

Solution code:
import math
L = [input() for _ in range(5)]
lm = 9
v = 0
for l in L:
  if int(l[-1])<lm and l[-1]!='0':
    lm = int(l[-1])
    v = int(l)
t = 0
L.remove(str(v))
for l in L:
  t += math.ceil(int(l)/10)*10
print(t + v)

Submission status: Runtime Error

Solution code:
X=[int(input()) for i in range(5)]

ans=0
W=[]

for i in range(len(X)):
    if X[i]%10 == 0:
        ans+=X[i]
    else:
        ans+=(X[i]//10)*10+10
        W.append(X[i]%10)

ans +=-10+min(W)
print(ans)

Submission status: Runtime Error

Solution code:
from math import ceil
tmp1 = list(map(int,input().split()))
tmp2 = list()
for j in range(5):
    if tmp1[j]%10 == 0:
        tmp2.append(0)
    else:
        tmp2.append(10 - tmp1[j]%10)
for i in range(5):
    tmp1[i] = ceil(tmp1[i]/10)*10
print(sum(tmp1)-max(tmp2))

Submission status: Runtime Error

Solution code:
from math import ceil
tmp1 = list(map(int,input().split()))
tmp2 = list()
for j in range(5):
    if tmp1[j]%10 == 0:
        tmp2.append(0)
    else:
        tmp2.append(10 - tmp1[j]%10)
for i in range(5):
    tmp1[i] = ceil(tmp1[i]/10)*10
print(tmp1)
print(tmp2)
print(sum(tmp1)-max(tmp2))

Submission status: Runtime Error

Solution code:
from math import ceil
tmp1 = list(map(int,input().split()))
tmp2 = list()
for j in range(5):
    if tmp1[j]%10 == 0:
        tmp2.append(float("inf"))
    else:
        tmp2.append(tmp1[j]%10)
for i in range(5):
    tmp1[i] = ceil(tmp1[i]/10)*10
print(tmp1)
print(tmp2)
print(sum(tmp1)-min(tmp2))

Submission status: Runtime Error

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

import math
p = [a, b, c, d, e]
pa = [a%10, b%10, c%10, d%10, e%10]
ans = math.ceil(a/10)*10 + math.ceil(b/10)*10 + math.ceil(c/10)*10 + math.ceil(d/10)*10 + math.ceil(e/10)*10 - (10 - pa[pa.index(min([i for i in pa if i != 0]))])
print(ans)

Submission status: Runtime Error

Solution code:
inp = []
tmp = 10
ans = 0
for _ in range(5):
    inp.append(input())
for i in range(5):
    if tmp > int(inp[i][-1]) and int(inp[i][-1]) != 0:
        tmp = int(inp[i][-1])
        temp = i
last = inp.pop(temp)
for j in inp:
    if j[-1] == "0":
        ans += int(j)
    else:
        ans += int(j[:-1]+ "0") + 10
ans += int(last)
print(ans)

Submission status: Runtime Error

Solution code:
inp = []
tmp = 9
ans = 0
for _ in range(5):
    inp.append(input())
for i in range(5):
    if tmp > int(inp[i][-1]) and int(inp[i][-1]) != 0:
        tmp = int(inp[i][-1])
        temp = i
last = inp.pop(temp)
for j in inp:
    if j[-1] == "0":
        ans += int(j)
    else:
        ans += int(j[:-1]+ "0") + 10
ans += int(last)
print(ans)

Submission status: Runtime Error

Solution code:
inp = []
tmp = 9
ans = 0
for _ in range(5):
    inp.append(input())
for i in range(5):
    if tmp > int(inp[i][-1]) and int(inp[i][-1]) != 0:
        tmp = int(inp[i][-1])
        temp = i

last = inp.pop(temp)
print(last)
for j in inp:
    print(ans)
    if j[-1] == "0":
        ans += int(j)
    else:
        ans += int(j[:-1]+ "0") + 10
ans += int(last)
print(ans)

Submission status: Runtime Error

Solution code:
import math
ls = [int(input()) for _ in range(5)]
ans = 0
num = []

for i in ls:
    ans += math.ceil(i/10)*10
    if str(i)[-1] != '0':
        num.append(str(i)[-1])

print(ans-10+min([int(i) for i in num]))

Submission status: Runtime Error

Solution code:
x = [int(input()) for i in range(5)]

x_1 = [int(i / 10) for i in x]
x_2 = [(i % 10) for i in x]

ans = sum(x_1)*10 

for i in range(x_2.count(0)):
    x_2.remove(0)

ans += min(x_2)
ans += (len(x_2)-1)*10

print(ans)

Submission status: Runtime Error

Solution code:
from math import ceil
A= [int(input()) for _ in range(5)]
rA = list(map(lambda x:x%10, A))
res = float('inf')
for i, r in enumerate(rA):
    if res>r>0:
        idx = i
        res = r
ans = A.pop(idx)
rA.pop(idx)
tA = [ceil(A[i]/10)*10 for i in range(len(A))]
print(sum(tA)+ans)

Submission status: Runtime Error

Solution code:
menu=[]
menu.append(input())
matubi=[]
for i in menu:
    matubi.append(i[:1:-1])
print(matubi.index(min(matubi)))

????

Submission status: Runtime Error

Solution code:
A= [int(input()) for _ in range(5)]
rA = list(map(lambda x:x%10, A))
res = float('inf')
for i, r in enumerate(rA):
    if res>r>0:
        idx = i
        res = r
ans = A.pop(idx)
rA.pop(idx)
tA = [A[i]+10-rA[i] for i in range(len(A))]
print(sum(tA)+ans)

Submission status: Runtime Error

Solution code:
#2019/10/04
time = list(map(int, open(0).read().split()))
# print(time)

time_residual = [i%10 for i in time]
# print(time_residual)

time_residual_notZero = [i for i in time_residual if i%10 != 0 ]
# print(time_residual_notZero)

ans = sum([-(-i//10)*10 for i in time]) + min(time_residual_notZero) - 10
#print(ans)

Submission status: Runtime Error

Solution code:
#2019/10/04
time = list(map(int, open(0).read().split()))
# print(time)

time_residual = [i%10 for i in time]
# print(time_residual)

time_residual_notZero = [i for i in time_residual if i%10 != 0 ]
# print(time_residual_notZero)

ans = sum([-(-i//10)*10 for i in time]) + min(time_residual_notZero) - 10
print(ans)

Submission status: Runtime Error

Solution code:
#2019/10/04
time = list(map(int, open(0).read().split()))
# print(time)

time_residual = [i%10 for i in time]
# print(time_residual)

time_residual_notZero = [i for i in time_residual if i%10 != 0 ]
# print(time_residual_notZero)

min_index = time_residual.index(min(time_residual_notZero))
# print(min_index)

ans = sum([-(-i//10)*10 for i in time]) + time_residual[min_index] - 10
print(ans)

Submission status: Runtime Error

Solution code:
import sys
import math
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

l = 9
ans = 0
for _ in range(5):
    num = ni()
    ans += -(-num//10) * 10
    if num % 10 != 0 and l > num % 10:
        l = num % 10
    elif num % 10 == 0:
        l = 10
if l != 0:
    ans += - 10 + l
print(ans)
```‘

Submission status: Runtime Error

Solution code:
import sys
lst=[]
ans=0
for i in range(5):
  a=int(input())
  if a%10==0:
    ans+=a
  else:
    lst.append(a)
C=[[] for _ in range(len(lst))]   
for i in range(len(lst)):
  v=lst[i]
  c=v%10
  C[i]=[-c,v]
C=sorted(C)
for i in range(len(lst)-1):
  v=C[i][1]
  c=-C[i][0]
  ans+=(v+(10-c))
print(ans+C[-1][1])

Submission status: Runtime Error

Solution code:
time = []
total = 0
for _ in range(5):
    t = int(input())
    if t % 10 == 0:
        total += t
    else:
        total += (t//10+1)*10
        time.append(t)

last = min(time, key=lambda x: int(str(x)[-1]))

print(total - 10+last%10)

Submission status: Runtime Error

Solution code:
import math
L = [int(input()) for _ in range(5)]
Lm = 10-min([i%10 for i in L if i%10 != 0])
if not Lm:
    Lm = 0
print(sum([10*math.ceil(i/10) for i in L])-Lm)

Submission status: Runtime Error

Solution code:
import math
L = [int(input()) for _ in range(5)]
Lm = 10-min([i%10 for i in L if i%10 != 0])
print(sum([10*math.ceil(i/10) for i in L])-Lm)

Submission status: Runtime Error

Solution code:
import math
L = list(map(int,open(0).read().split()))
Lm = min([i//10 for i in L])
print(sum([10*math.ceil(i/10) for i in L])-Lm)
import math
L = list(map(int,open(0).read().split()))
Lm = max([10-(i//10) for i in L])
print(sum([10*math.ceil(i/10) for i in L])-Lm)

Submission status: Runtime Error

Solution code:
n = [input() for i in range(5)]
flag = 1
ans = 0
while flag:
    flag = 0
    for i in range(len(n)-1,0,-1):
        if n[i][-1] < n[i-1][-1]:
            n[i],n[i-1] = n[i-1],n[i]
            flag = 1
for i in range(len(n)):
    if n[i][-1] != '0':
        n[i] = int(n[i])
        l = n.pop(i)
        break
for i in range(len(n)):
    n[i] = int(n[i])
for i in range(len(n)):
    while n[i]%10 != 0:
        n[i] += 1
    ans += n[i]
ans += l
print(ans)

Submission status: Runtime Error

Solution code:
n = [int(input()) for _ in range(5)]
first_digit = []
for num in n:
    z = int(str(num)[-1])
    if z > 0:
        first_digit.append(z)

# print(first_digit)
t = 0
for i in range(len(n)):
    t += -(-n[i] // 10) * 10
print(t - (10 - min(first_digit)))