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:
input_list=[input() for i in range(5)]
dishes = [int(n) for n in input_list]
s = 0
for n in dishes:
    if n%10 == 0:
        s += n

dishes = [n for n in dishes if n%10 != 0]
minmod = min([n%10 for n in dishes])


for n in dishes:
    s += n + 10 - n%10

s -= 10
s += minmod
print(s)

Submission status: Runtime Error

Solution code:
import math
a = []
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))
t = []
b = []
u = []
for i in a:
	if(i%10 == 0):
		b.append(i)
	else:
		t.append(i)
		u.append(i%10)
min_t = u.index(min(u))
ss = t.pop(min_t)
u.pop(min_t)

for i in range(len(t)): 
	u[i] = 10 - u[i]
	t[i] = t[i] + u[i]
print(sum(b) + sum(t) + ss)

Submission status: Runtime Error

Solution code:
l=[input() for i in range(5)]
a=[0, 0, 0, 0, 0]
e=9
for i in range(5):
  if e >= int(l[i][-1]) and not(int(l[i][-1]) == 0):
      a[4] = l[i]

l.remove(a[4])
l = [int(i) for i in l]
for j in range(4):
  while(not(int(l[j]) % 10 is 0)):
    l[j]+=1
  a[j] = int(l[j])
a[4] = int(a[4])
print(sum(a))

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
list1 = [a,b,c,d,e]
list2 = ["a","b","c","d","e"]
list3 = {}

for i,j in zip(list1,list2):
  i = i - 1
  sum = 1
  if i % 10 = 0:
    i = sum
  else:
    pass
  sum += 1
  list3[j] = sum
list3.sort()
list3.values()
    
  
def pri(kan):
  if kan <= 10:
    return 10
  if kan > 10 and kan <=20:
    return 20
  if kan > 20 and kan <=30:
    return 30
  if kan > 30 and kan <=40:
    return 40
  if kan > 40 and kan <=50:
    return 50
  if kan > 50 and kan <=60:
    return 60
  if kan > 60 and kan <=70:
    return 70
  if kan > 70 and kan <=80:
    return 80
  if kan > 80 and kan <=90:
    return 90
  if kan > 90 and kan <=100:
    return 100
  if kan > 100 and kan <=110:
    return 110
  if kan > 110 and kan <=120:
    return 120
  if kan > 120 and kan <=130:
    return 130
  if kan > 130 and kan <=140:
    return 140
A = pri(list3[4])
B = pri(list3[3])
C = pri(list3[2])
D = pri(list3[1])
E = list3[0]
print(A+B+C+D+E)

Submission status: Runtime Error

Solution code:
from collections import Counter
from functools import reduce
import fractions
import math
import statistics
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]  # LIST INT
def LF(): return [float(x) for x in sys.stdin.readline().split()]  # LIST FLOAT
def LS(): return sys.stdin.readline().split()  # LIST STRING
def MI(): return map(int, sys.stdin.readline().split())  # MAP INT
def II(): return int(sys.stdin.readline())  # INPUT INT
def IS(): return input()  # INPUT STRING
def P(x): return print(x)
def C(x): return Counter(x)
def GCD_LIST(numbers):  # greatest common divisor
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):  # least common multiple
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))
# n = II()
# dp = [INF] * n
# h = LI()
# dp[0], dp[1] = 0, abs(h[1] - h[0])
# for i in range(2, n):
    # dp[i] = min(dp[i-1] + abs(h[i]-h[i-1]), dp[i])
    # dp[i] = min(dp[i-2] + abs(h[i]-h[i-2]), dp[i])
# P(dp[n-1])


a = IS()
b = IS()
c = IS()
d = IS()
e = IS()
ryo = [a, b, c, d, e]
ryo = sorted(ryo, key=lambda x:x[-1])[::-1]
least = '9'
for i in ryo:
    if int(least) >= int(i[-1]) and int(i[-1]) != 0:
        least = i[-1]
for i in range(len(ryo)):
    if ryo[i][-1] == least:
        number = ryo.pop(i)
        break
for i in range(len(ryo)):
    for j in range(0,140,10):
        if int(ryo[i]) <= j:
            ryo[i] = j
            break
print(sum(ryo) +int(number))

Submission status: Runtime Error

Solution code:
import sys
from itertools import permutations

a = [int(i) for i in sys.stdin]

b = [(list(map(int, str(k)))[-1], i) for i, k in enumerate(a)]

indexes = [i for i, (x, y)in enumerate(b) if x == 0]
d = 0
for i in sorted(indexes)[::-1]:
  d += a[i]
  b.pop(i)
b.sort()
c = b[::-1]

for i, k in c[:-1]:
  if i >= 5:
    d += round(a[k], -1)
  else:
    d += (round(a[k], -1) + 10)
d += a[c[-1][1]]
print(d)

Submission status: Runtime Error

Solution code:
l=[input() for i in range(5)]
a=[0, 0, 0, 0, 0]
e=9
for i in range(5):
  if e >= int(l[i][-1]) and not(int(l[i][-1]) == 0):
      a[4] = l[i]

l.remove(a[4])
l = [int(i) for i in l]
for j in range(4):
  while(not(int(l[j]) % 10 is 0)):
    l[j]+=1
  a[j] = int(l[j])
a[4] = int(a[4])
print(sum(a))
print(a[4])

Submission status: Runtime Error

Solution code:
import numpy as np
T = np.array([int(input()) for i in range(5)])

T_0 = T[np.mod(T, 10) == 0]
T_o = T[np.mod(T, 10) != 0]
T_c = T_o + 10 - np.mod(T_o, 10)
T_s = np.sort(np.mod(T_o, 10))

if T_0 != np.array([0,0,0,0,0]):
    A = np.sum(T_c) - 10 + np.sum(T_0) + T_s[0]
    print(A)
else:
    A = np.sum(T_0)
    print(A)

Submission status: Runtime Error

Solution code:
import numpy as np
T = np.array([int(input()) for i in range(5)])

T_0 = T[np.mod(T, 10) == 0]
T_o = T[np.mod(T, 10) != 0]
T_c = T_o + 10 - np.mod(T_o, 10)
T_s = np.sort(np.mod(T_o, 10))
print(T_0,T_o,T_c,T_s)
if T_0 != np.array([0,0,0,0,0]):
    A = np.sum(T_c) - 10 + np.sum(T_0) + T_s[0]
    print(A)
else:
    A = np.sum(T_0)
    print(A)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
n = [int(input()) for i in range(5)]
hld = 9
answer = 0
zaro_count = 1
for i in n:
  last_dig = i % 10
  if last_dig <= hld:
    hld = last_dig
    if last_dig == 0:
      zero_count += 1
  answer += math.ceil(i/10)*10
print(answer - 10*zero_count + hld)

Submission status: Runtime Error

Solution code:
 mod0 = []
lst = []
for i in range(5):
    inp = int(input())
    if inp % 10 == 0:
        mod0.append(inp)
    else:
        lst.append(inp)

ans = sum(mod0)
last = 0
for n, i in enumerate(lst):
    for nn, ii in enumerate(lst):
        if i % 10 < ii % 10:
            last = i
        else:
            last = ii

for i, ii in enumerate(lst):
    if ii == last:
        continue
    ans += (ii // 10 + 1) * 10

print(ans+last)

Submission status: Runtime Error

Solution code:
import math
dish = []
mini = 0
for i in range(5):
    d = input()
    dish.append(d)
for j in dish:
    if j[-1] != '0':
        mini = j
for k in dish:
    if (k[-1] <= mini[-1]) and k[-1] != '0':
        mini = k
if mini == 0:
    mini = dish[0]
for i in range(5):
    if dish[i] == mini:
        dish.pop(i)
        break
time = 0
for l in range(4):
    dish[l] = math.ceil((int(dish[l]) / 10)) * 10
    time += int(dish[l])
time += int(mini)
print(time)

Submission status: Runtime Error

Solution code:
cook = []
amari = []
t = 0
for i in range(5):
    cook.append(int(input()))

for i in range(5):
    if cook[i] % 10 != 0:
        t += cook[i] + (10 - cook[i] % 10)
    else:
        t += cook[i]

for i in range(5):
    if cook[i] % 10 != 0:
        amari.append(10 - cook[i] % 10)

print(t - max(amari))

Submission status: Runtime Error

Solution code:
import numpy as np
T = np.array([int(input()) for i in range(5)])

T_0 = T[np.mod(T, 10) == 0]
T_o = T[np.mod(T, 10) != 0]
T_c = T_o + 10 - np.mod(T_o, 10)
T_s = np.sort(np.mod(T_o, 10))

if np.all(T_0 == 0) == False:
    A = np.sum(T_c) - 10 + np.sum(T_0) + T_s[0]
    print(A)
else:
    A = np.sum(T_0)
    print(A)

Submission status: Runtime Error

Solution code:
import math

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

br = 0
for r in range(1, 10):
    for i in range(5):
        if((arr[i] % 10) == r):
            last = i
            br = 1
            break
        pass
    if(br == 1):
        break
    pass

time = 0
for i in range(5):
    time += math.ceil(arr[i]/10) * 10

time += arr[last] - math.ceil(arr[last]/10) * 10

print(time)

Submission status: Runtime Error

Solution code:
x = [int(input()) for i in range(5)]
y = []
for i in range(5):
    tmp = x[i]%10
    if(tmp!=0):
        y.append(tmp)
md = min(y)
print(sum(x[i]//10 for i in range(5))*10 + (len(y)-1)*10+md)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
l=[a,b,c,d,e]
last=9
for i in range(5):
    if l[i]%10!=0:
        last=min(last,l[i]%10)
        
sum=0
if a%10==0 and b%10==0 and c%10==0 and d%10==0 and e%10==0:
    print(sum(l))
else:
    for i in range(5):
        if l[i]%10==0:
            sum+=l[i]
        else:
            sum+=l[i]+10-l[i]%10
    print(sum-10+last)

Submission status: Runtime Error

Solution code:
# -*- 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)

Submission status: Runtime Error

Solution code:
import math
dish = []
for i in range(5):
    d = input()
    dish.append(d)
for j in dish:
    if j[-1] != '0':
        mini = j
for k in dish:
    if (k[-1] <= mini[-1]) and k[-1] != '0':
        mini = k
for i in range(5):
    if dish[i] == mini:
        dish.pop(i)
        break
time = 0
for l in range(4):
    dish[l] = math.ceil((int(dish[l]) / 10)) * 10
    time += int(dish[l])
time += int(mini)
print(time)

Submission status: Runtime Error

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

N=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
X=[a%10,b%10,c%10,d%10,e%10]
X.remove([i for i, x in enumerate(X) if x == 0])
if a==b==c==d==e:
  print(N-min(X))
else:
  print(N-(10-min(X)))

Submission status: Runtime Error

Solution code:

t = [int(input()) for i in range(5)]
min=9
length=len(t)
for i in range(length):
    if min%10>t[i]%10 and t[i]%10!=0:
        min=t[i]
t.remove(min)
t.append(min)
ans=0
for _ in range(length-1):
    if t[_]%10!=0:
        ans+=t[_]+10-t[_]%10
    else:
        ans+=t[_]
print(ans+t[length-1])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
ans = 0
nums =[a, b, c, d, e]
tmp = [i % 10 for i in nums]
mm = [10 - i % 10 for i in nums]
mm = [x for x in mm if x != 10]
tmp = set(tmp)
tmp = list(tmp)
for i in range(5):
    if nums[i] % 10 == 0:
        ans += nums[i]
    else:
        ans += nums[i] + (10 - nums[i] % 10)
print(ans - max(mm))

Submission status: Runtime Error

Solution code:
#下1桁が小さい(しかし0でない)物を最後に残す
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
S=a+b+c+d+e
A=a%10
B=b%10
C=c%10
D=d%10
E=e%10
ListN=[]
if A!=0:
  ListN.append(A)
if B!=0:
  ListN.append(B)
if C!=0:
  ListN.append(C)
if D!=0:
  ListN.append(D)
if E!=0:
  ListN.append(E)
ListN.sort()
if len(N)==0:
  print(S)
else:
  Listn=[]
  for i in range(0,len(N),1):
    q=10-int(ListN[i])
    S+=q
  print(S)

Submission status: Runtime Error

Solution code:
import math
a,b,c,d,e=[int(input()) for i in range(5)]
x=[]
y=[]
def ceil(src, range):
  return ((int)(src / range) + 1 ) * range
for s in [a,b,c,d,e]:
  if s%10 != 0:
    x.append(s%10)
  y.append(ceil(s,10))
t=min(x)
if a%10==0 and b%10==0 and c%10==0 and d%10==0 and e%10==0:
  print(a+b+c+d+e)
else:
  ans = sum(y)
  ans= ans-10+t
  print(ans)

Submission status: Runtime Error

Solution code:
import math
menu = []
for i in range(0, 5):
        menu.append(int(input()))
df = max([10 - i % 10 for i in menu if i % 10 != 0 ])
sum = 0
for i in menu:
        sum += ((i + 9) // 10) * 10
if(len(df) == 0):
        print(sum)
else:
        print(sum-df)

Submission status: Runtime Error

Solution code:
def ceil(v):
	if v % 10 == 0:
		return v
	else:
		return (v // 10+1) *10

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

times = [A,B,C,D,E]

minMod = 9
last = -1
for time in times:
	if minMod > (time+9) % 10:
		minMod = (time+9) % 10
		last = time
		
times.remove(last)

for i,time in enumerate(times):
	times[i] = ceil(time)
	
times.append(last)

print(sum(times))

Submission status: Runtime Error

Solution code:
import math
menu = []
for i in range(0, 5):
        menu.append(int(input()))
df = max([10 - i % 10 for i in menu if i % 10 != 0 ])
sum = 0
for i in menu:
        sum += ((i + 9) // 10) * 10
if(df == 0):
        print(sum)
else:
        print(sum-df)

Submission status: Runtime Error

Solution code:
def ceil(v):
	if v % 10 == 0:
		return v
	else:
		return (v // 10+1) *10

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

times = [A,B,C,D,E]

minMod = 9
last = -1
for time in times:
	if minMod > (time+9) % 10:
		minMod = (time+9) % 10
		last = time
		
times.remove(last)

for i,time in enumerate(times):
	times[i] = ceil(time)
	
times.append(last)

print(times)
print(sum(times))

Submission status: Runtime Error

Solution code:
num.append(d%10)
num.append(e%10)

cnt = 0
for i in range(len(num)):
  if num[i] == 0:
    cnt += 1
ans = min(num)
x = 10
if min(num) == 0:
  if a%10 != 0 and b%10 != 0 and a%10 > b%10:
    x = b%10
  if b%10 != 0 and c%10 != 0 and x > c%10:
    x = c%10
  if c%10 != 0 and d%10 != 0 and x > d%10:
    x = d%10
  if d%10 != 0 and e%10 != 0 and x > e%10:
    x = e%10
  sum = a+(10-a%10) + b+(10-b%10) + c+(10-c%10) + d+(10-d%10) + e+(10-e%10)-10-10*cnt+x
elif min(num) == 0 and max(num) == 0:
  sum = a+(10-a%10) + b+(10-b%10) + c+(10-c%10) + d+(10-d%10) + e+(10-e%10)-10-10*cnt+x
else:  
  sum = a+(10-a%10) + b+(10-b%10) + c+(10-c%10) + d+(10-d%10) + e+(10-e%10)-10-10*cnt+ans

print(sum)

Submission status: Runtime Error

Solution code:
import math
n = [int(input()) for i in range(5)]
lastdig = min(m)
answer = 0
m = []
for i in n:
  answer += math.ceil(i/10)*10
  m.append(i%10)
lastdig = min(m)
print(answer - 10 + lastdig)

Submission status: Runtime Error

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

res = 0
li = []
dic = {}
for i in range(5):
    li.append(int(input()))
for i in range(5):
    if li[i] % 10 != 0 and li[i] % 10 not in dic.values():
        dic[i] = li[i] % 10
m = min(dic.values())
for j in range(5):
    if li[j] % 10 == 0:
        res += li[j]
    else:
        if li[j] % 10 == m and j in dic.keys():
            res += li[j]
        else:
            res += (li[j] // 10 + 1) * 10
print(res)

Submission status: Runtime Error

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

D_mod_max = 9
for i in range(5):
  if (D[i]%10 != 0) & (D[i]%10 < D_mod_max):
    D_remove = D[i]
    D_mod_max = D[i]%10
    
D.remove(D_remove)

sum=0
for i in range(len(D)):
  if D[i]%10 !=0:
    sum=sum+D[i]+(10-D[i]%10)
  else:
    sum=sum+D[i]

sum=sum+D_remove

print(sum)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
s=a+b+c+d+e
li=[a,b,c,d,e]
for i in range(5) :
   li[i]=10-(li[i]%10)
while max(li)==10 :
   li.remove(max(li))
li.remove(max(li))
print(s+sum(li))

Submission status: Runtime Error

Solution code:
import math

data=[]
for i in range(5):
    data.append(int(input()))

ans=[10-(i-1)%10 if i%10!=0 else None for i in data]

check=ans.index(max(ans))
X=data.pop(check)
print(X)
data=[math.ceil(x/10)*10 for x in data]
print(sum(data)+X

Submission status: Runtime Error

Solution code:
import math

num = [input() for _ in range(5)]
num2 = sorted([list(i)[-1] for i in num],reverse = False)

num3 = [n for n in num2 if n != "0" ]



C = 0
c = 1

for i in num:
	j = list(i)[-1]
  
	if j == num3[0] and c == 1:
		C += int(i)
		c += 1
	elif c>1:
		if int(j) >= 5 or int(j) == 0:
			C += round(int(i),-1)
			#print(round(C))
			
                  
		elif 0< int(j) < 5:
			C += round(int(i),-1)+10		
        
        
	else:
		if int(j) >= 5 or int(j) == 0:
			C += round(int(i),-1)
			#print(round(C))
			
                  
		elif 0< int(j) < 5:
			C += round(int(i),-1)+10	
		#	print(round(C))


print(C)

Submission status: Runtime Error

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

res = 0
li = []
dic = {}
for i in range(5):
    li.append(int(input()))
    if li[i] % 10 != 0 and li[i] % 10 not in dic.values():
        dic[i] = li[i] % 10
m = min(dic.values())
for j in range(5):
    if li[j] % 10 == 0:
        res += li[j]
    else:
        if li[j] % 10 == m and j in dic.keys():
            res += li[j]
        else:
            res += (li[j] // 10 + 1) * 10
print(res)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

import math

li = []
for i in range(5):
    li.append(int(input()))

s = 0
for f in li:
    s += (f//10)*10 + 10*(int(bool(f%10)))

li2 = []
for f in li:
    if f%10 != 0:
        li2.append(f%10)

print(s + min(li2) - 10)

Submission status: Runtime Error

Solution code:
import math
n = [int(input()) for i in range(5)]
m = [int(input()) % 10 for i in range(5)]
lastdig = min(m)
answer = 0
for i in n:
  answer += math.ceil(i/10)*10
print(answer - 10 + lastdig)

Submission status: Runtime Error

Solution code:
import math
menu = []
for i in range(0, 5):
        menu.append(int(input()))
df = max([10 - i % 10 for i in menu if i%10!=0 ])
sum = 0
for i in menu:
        sum += ((i + 9) // 10) * 10
print(sum-df)

Submission status: Runtime Error

Solution code:
a,b,c,d,e=[int(input()) for i in range(5)]
x=[]
y=[]
for s in [a,b,c,d,e]:
  if s%10 != 0:
    x.append(s%10)
  y.append(round(s,-1))
t=min(x)
if a%10==0 and b%10==0 and c%10==0 and d%10==0 and e%10==0:
  print(a+b+c+d+e)
else:
  ans = sum(y)
  ans= ans-10+t
  print(ans)

Submission status: Runtime Error

Solution code:
l,s = [],[]
for i in range(5):
    num = int(input())
    l.append(num)
    s.append(num%10)

res = 0

s = list(set(s))
if 0 in s:
    s.remove(0)

for i in l:
    if i%10!=0:
        res += (i+10)//10*10
    else:
        res += i
else:
    tmp = min(s)
    print(res-(10-tmp)) if len(s)!=0 else print(res)

Submission status: Runtime Error

Solution code:
import math
n = [int(input()) for i in range(5)]
m = [int(input()) % 10 for i in range(5)]
lastdig = min(m)
for i in n:
  answer += math.ceil(i/10)*10
print(answer - 10 + lastdig)

Submission status: Runtime Error

Solution code:
import math
menu = []
for i in range(0, 5):
        menu.append(int(input()))
df = max([10 - i % 10 for i in menu if i%10!=0 ])
sum = 0
for i in menu:
        sum += ((i + 9) // 10) * 10
print(sum+df-10)

Submission status: Runtime Error

Solution code:
T = []
for i in range(5):
    T.append(input())
tmp = []
for i in range(5):
    tmp.append(int(T[i][-1]))
ans = []
for i in range(5):
    if 0 < tmp[i] and tmp[i] <= 5:
        ans.append(i)

lastidx = tmp.index(min([tmp[x] for x in ans]))

sum_ = 0
for i in range(5):
    if tmp[i] == 0:
        sum_ += int(T[i])
    else:
        sum_ += (int(T[i]) + 10 - tmp[i])
print(sum_ - 10 + tmp[lastidx])

Submission status: Runtime Error

Solution code:
import math

num = [input() for _ in range(5)]
num2 = sorted([list(i)[-1] for i in num],reverse = False)

num3 = [n for n in num2 if n != "0" ]



C = 0

for i in num:
	j = list(i)[-1]
  
	if j == num3[0]:
		C += int(i)
		
        
        
	else:
		if int(j) >= 5 or int(j) == 0:
			C += round(int(i),-1)
			#print(round(C))
			
                  
		elif 0< int(j) < 5:
			C += round(int(i),-1)+10	
		#	print(round(C))


print(C)

Submission status: Runtime Error

Solution code:
import math
n = [int(input()) for i in range(5)]
m = [10 * int(input()) for i in range(5)]
lastdig = min(m)
for i in n:
  answer += math.ceil(i/10)*10
print(answer - 10 + lastdig)

Submission status: Runtime Error

Solution code:
inp = []
for i in range(5):
    inp.append(int(input()))
inp2 = sorted(inp, key=lambda x: x%10)
inp3 = [d for d in inp2 if d%10 != 0]
last = inp3[0]
inp2.remove(last)

r = 0
for c,z in enumerate(inp2):
    if z%10 == 0:
        r += z
    else:
        r += z//10 * 10 + 10
res = r + last
print(res)

Submission status: Runtime Error

Solution code:
a = [int(input()) for i in range(5)]
r = 10
fix = 10000
for i in range(5):
    if a[i] % 10 == 0:
        fix = i
    elif a[i] % 10 < r:
        last = i
        r = int(a[i] % 10)

if fix == 10000:
    b = []
    for i in range(5):
        if i != last:
            b.append(a[i])
    
    b = [int((b[i] + 9) / 10) * 10 for i in range(4)] 

    time = 0
    for i in range(4):
        time = time + b[i]
    
    time = time + a[last]


else:
    b = []
    for i in range(5):
        if i != fix and i != last:
            b.append(a[i])

    b = [int((b[i] + 9) / 10) * 10 for i in range(3)]

    time = 0
    for i in range(3):
        time = time + b[i]

    time = time + a[fix] + a[last]

print(time)

Submission status: Runtime Error

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


t =0
for i,m in enumerate(a):
    t += int(m/10) * 10
    if m%10 != 0:
        t = t + 10

b = [10 - (x%10) for x in a]
b = list(filter(lambda x:x !=10, b))
print(t - max(b))

Submission status: Runtime Error

Solution code:
import math
time_list=[]

for _ in range(5):
    time_list.append(int(input()))
# print(1, time_list)

time_list2=[]
for x in time_list:
    m = x % 10
    if m!=0:
        time_list2.append(x+(10-m))
    else:
        time_list2.append(x)
# print("2", time_list2)
# print(round(102,-1))

mod_list = []
for x in time_list:
    m = x % 10
    if m!=0:
        mod_list.append(10-m)
min_ = max(mod_list)
# print(mod_list)



print(sum(time_list2)-min_)

Submission status: Runtime Error

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

l = []
ans = 0
for t in [a,b,c,d,e]:
  if t%10 == 0:
    ans += t
  else:
    l.append(t)

if len(l) < 1:
  print(ans)10
elif len(l) == 1:
  print(ans + l[0])
else:
  l = sorted(l, key=lambda x: x%10, reverse=True)

  def tyumon(t, ans):
    ans += t
    if ans % 10 == 0:
      return ans
    else:
      return (ans//10 + 1)*10

  for i in range(len(l)-1):
    ans = tyumon(l[i], ans)
  print(ans + l[-1])

Submission status: Runtime Error

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

if a%10 == 0:
    aa = 0
else:
    aa = 10-a%10
if b%10 ==0:
    bb = 0
else:
    bb = 10-b%10
if c%10 == 0:
    cc = 0
else:
    cc = 10-c%10
if c%10 == 0:
    cc = 0
else:
    dd = 10-d%10
if e%10 == 0:
    ee = 0
else:
    ee = 10-e%10

lastorder = max(aa,bb,cc,dd,ee)

if(aa == lastorder):
    ans = b+bb+c+cc+d+dd+e+ee+a
if(bb == lastorder):
    ans = a+aa+c+cc+d+dd+e+ee+b
if(cc == lastorder):
    ans = a+aa+b+bb+d+dd+e+ee+c
if(dd == lastorder):
    ans = a+aa+b+bb+c+cc+e+ee+d
if(ee == lastorder):
    ans = a+aa+b+bb+c+cc+d+dd+e

print(ans)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
s=a+b+c+d+e
li=[a,b,c,d,e]
for i in range(5) :
   li[i]=10-(li[i]%10)
while max(li)==10 :
   li.remove(max(li))
li.remove(max(li))
s+=sum(li)
print(s)

Submission status: Runtime Error

Solution code:
inp = []
for i in range(5):
    inp.append(int(input()))
inp2 = sorted(inp, key=lambda x: x%10)
inp3 = [d for d in inp2 if d%10 != 0]
last = inp3[0]
inp2.remove(last)
print(inp,inp2,inp3,last)

r = 0
for c,z in enumerate(inp2):
    if z%10 == 0:
        r += z
    else:
        r += z//10 * 10 + 10
    print(z,r)
res = r + last
print(res)

Submission status: Runtime Error

Solution code:
import math
n = [int(input()) for i in range(5)]
lastdig = min(n%10)
for i in n:
  answer += math.ceil(i/10)*10
print(answer - 10 + lastdig)

Submission status: Runtime Error

Solution code:
import math
menu = []
for i in range(0, 5):
        menu.append(int(input()))
df = max([10 - i % 10 for i in menu if i%10!=0 ])
sum = 0
for i in menu:
        sum += ((i + 9) // 10) * 10
print(sum-10+df)

Submission status: Runtime Error

Solution code:
import math

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



ans = 0
for i in [a, b, c, d, e]:
    ans += int(math.ceil(i/10)*10)

li = [int(str(a)[-1]), int(str(b)[-1]), int(str(c)[-1]), int(str(d)[-1]), int(str(e)[-1])]
while 0 in li:
    li.remove(0)

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

Submission status: Runtime Error

Solution code:
#c = [list(map(int,input().split())) for _ in range(5)]
c = [int(input()) for _ in range(5)]

last = 10

for i in range(5):
    if c[i] % 10 ==  0:
        continue
    else:
        if last > c[i] % 10:
            last = c[i] % 10
            idx = i
    
ans = 0


for i in range(5):
    if i == idx:
        ans = ans + c[i]
    else:
        if c[i] % 10 == 0:
            ans = ans + c[i]
        else:
            ans= ans + ( c[i] // 10 + 1 ) * 10


print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
menu = []
for i in range(0, 5):
        menu.append(int(input()))
df = max([10 - i % 10 for i in menu if i%10!=0 ])
print(df)
sum = 0
for i in menu:
        sum += ((i + 9) // 10) * 10
print(sum-10+df)

Submission status: Runtime Error

Solution code:
import math

cycles = []
for i in range(5):
    cycles.append(int(input()))


minimum_last_order_cycle = 9
for cycle in cycles:
    if cycle % 10 <= minimum_last_order_cycle % 10 and cycle % 10 > 0:
        minimum_last_order_cycle = cycle

cycles.remove(minimum_last_order_cycle)

time = 0
for cycle in cycles:
    time += math.ceil(cycle / 10) * 10

time += minimum_last_order_cycle

print(time)

Submission status: Runtime Error

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

if a%10 == 0:
    aa = 0
else:
    aa = 10-a%10
if b%10 ==0:
    bb = 0
else:
    bb = 10-b%10
if c%10 == 0:
    cc = 0
else:
    cc = 10-c%10
if c%10 == 0:
    cc = 0
else:
    dd = 10-d%10
if e%10 == 0:
    ee = 0
else:
    ee = 10-e%10

lastorder = max(aa,bb,cc,dd,ee)

if(aa == lastorder):
    ans = b+bb+c+cc+d+dd+e+ee+a
elif(bb == lastorder):
    ans = a+aa+c+cc+d+dd+e+ee+b
elif(cc == lastorder):
    ans = a+aa+b+bb+d+dd+e+ee+c
elif(dd == lastorder):
    ans = a+aa+b+bb+c+cc+e+ee+d
elif(ee == lastorder):
    ans = a+aa+b+bb+c+cc+d+dd+e

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

A = list(str(a))
B = list(str(b))
C = list(str(c))
D = list(str(d))
E = list(str(e))

S = []
sum = 0
if A[-1] == "0":
  sum += a
else:
  S.append(A[-1])
  sum += a + (10 - int(A[-1]))

if B[-1] == "0":
  sum += b
else:
  S.append(B[-1])
  sum += b + (10 - int(B[-1]))

if C[-1] == "0":
  sum += c
else:
  S.append(C[-1])
  sum += c + (10 - int(C[-1]))

if D[-1] == "0":
  sum += d
else:
  S.append(D[-1])
  sum += d + (10 - int(D[-1]))

if E[-1] == "0":
  sum += e
else:
  S.append(E[-1])
  sum += e + (10 - int(E[-1]))

if len(S) != "0":
  k = np.argmin(S)
  sum += int(S[k]) - 10
print(sum)