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:
A=[int(input()) for  i in range(5)]
B=[int(str(A[i])[-1]) for i in range(5)]
if B==[0]*5:
	print(sum(A))
else:
	for i in range(5):
		if B[i]==0:
			B[i]=10
	ans=min(B)
	o=B.index(ans)
print((sum(A)-A[o])+10-(sum(A)-A[o])%10+A[o])

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
 
min_list = [a,b,c,d,e]
min_q = [(a%10),(b%10),(c%10),(d%10),(e%10)]
q_min = min(min_q)
min_index = min_q.index(q_min)
new_min = min_list.pop(min_index)

minute = 0
for i in range(len(new_min)):
    if (new_min[i]%10)==0:
        minute += new_min[i]
    else:
        minute = 10-(new_min[i]%10)+new_min[i]
 
minute += min_list[min_index]
 
print(minute)

Submission status: Runtime Error

Solution code:
import math

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

# print(n)

# array = [a, b, c, d, e]
"""
if n >= a:
    if a >= b:
        if b >= c:
            if c >= d:
                if d >= e:
                    print(5)

上記の組み合わせは５通り。
ここから、n < a の時、ceil(n/a) 切り上げ分だけ、足す。

"""
i = 5
if n <= a:
    if a <= b:
        if b <= c:
            if c <= d:
                if d <= e:
                    pass
                else:
                    i += math.ceil(d/e) -1
            else:
                i += math.ceil(c/d) -1
        else:
            i += math.ceil(b/c) -1
    else:
        i += math.ceil(a/b) - 1
else:
    i += math.ceil(n/a) - 1
    # print(math.ceil(n/a))

print(i)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr  6 21:47:51 2019

@author: Tabe
"""

dish = list()

fst = list()

bsum = list()

flag = False
#すべての入力を得る
for i in range(5):
    dish.append(int(input()))

sdish = [str(n) for n in dish]

print(sdish)
#1の位を取得
for index, val in enumerate(sdish):
    fst.append(int(val[-1]))

#0を除く一番小さいもののインデックス番号を取得
for index, val in enumerate(fst):
    for i in  range(10):
        if i+1 == val:
            minIndex = index
            flag = True
            break
    if flag == True:
        break;
minData = dish[minIndex]


dish.pop(minIndex)

#一番小さいものを除いたデータの合計値を取得
for value in  dish:
    t = str(value)
    i = int(t[0])
    bsum.append((i + 1)* 10 ^ (value-1))

sumData = sum(bsum)

#合計
print(sumData + minData)

Submission status: Runtime Error

Solution code:
import math
S = [input() for i in range(5)]
#合計時間
num = 0
#ポイント
point = int(S[0])
for i in range(1,5):
  if point[-1] == 0:
    num += point
    point = S[i]
  else:
    if point[-1] > int(S[i][-1]):
      num += point + 10 - point[-1]
      point = S[i]
    else:
      num += int(S[i]) +10 - intS[i][-1]
   
    
num += point

print(num)

Submission status: Runtime Error

Solution code:
array = [int(input()) for i in range(5)]
array_sub = [i % 10 for i in array]
new_lst = [i for i in array_sub if i != 0]
minimum = min(new_lst)
sum = 0
for i in array:
  if (i % 10 == minimum):
    sum += i
  else:
    sum += i + (10 - i % 10)
print(sum)

Submission status: Runtime Error

Solution code:
def solve():
    time_dish=[0]*5
    for i in range(5):
        time_dish[i]=int(input())
    time=0
    x=10
    for i in range(5):
        #if time_dish[i]%10 != 10:
        time += math.ceil(time_dish[i]/10)*10
        if (time_dish[i]%10 != 0) and (x > time_dish[i]%10):
            x = time_dish[i]%10
    if x == 10:
        print(time)
    else:
        print(time-10+x)

solve()

Submission status: Runtime Error

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

l = [a, b, c, d, e]
d = list()

for i, x in enumerate(l[:-1]):
    l2 = l[i+1:]
    for y in l2:
        d.append(y-x)

if max(d) <= k:
    print('Yay!')
else:
    print(':(')

Submission status: Runtime Error

Solution code:
array = [int(input()) for i in range(5)]
array_sub = [i % 10 for i in array]
new_lst = [i for i in array_sub if i != 0]
minimum = min(new_lst)
sum = 0
for i in array:
  if (i % 10 == minimum):
    sum += i
  else 
  	sum += i + (10 - i % 10)
print(sum)

Submission status: Runtime Error

Solution code:
int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
 
min_list = [a,b,c,d,e]
min_q = [(a%10),(b%10),(c%10),(d%10),(e%10)]
q_min = min(min_q)
min_index = min_q.index(q_min)
new_min = min_list.pop(min_index)

minute = 0
for i in range(len(min_list)):
    if (min_list[i]%10)==0:
        minute += min_list[i]
    else:
        minute = 10-(min_list[i]%10)+min_list[i]
 
minute += min_list[min_index]
 
print(minute)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
T = []
a=A%10
b=B%10
c=C%10
d=D%10
e=E%10

if a==0:
	AA=round(A,-1)
elif a>=5:
	AA=round(A,-1)
else:
	AAA=A+5
	AA=round(AAA,-1)
	T.append(a)

if b==0:
	BB=round(B,-1)
elif b>=5:
	BB=round(B,-1)
else:
	BBB=B+5
	BB=round(BBB,-1)
	T.append(b)

if C==0:
	CC=round(C,-1)
elif c>=5:
	CC=round(C,-1)
else:
	CCC=C+5
	CC=round(CCC,-1)
	T.append(c)

if d==0:
	DD=round(D,-1)
elif d>=5:
	DD=round(D,-1)
else:
	DDD=D+5
	DD=round(DDD,-1)
	T.append(d)

if e==0:
	EE=round(E,-1)
elif e>=5:
	EE=round(E,-1)
else:
	EEE=E+5
	EE=round(EEE,-1)
	T.append(e)

if min(T)==a:
	print(A+BB+CC+DD+EE)
elif min(T)==b:
	print(AA+B+CC+DD+EE)
elif min(T)==c:
	print(AA+BB+C+DD+EE)
elif min(T)==d:
	print(AA+BB+CC+D+EE)
else:
	print(AA+BB+CC+DD+E)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python

A = [input() for i in range(5)]
m = 9
flag = True
for a in A:
    if int(a[-1]) == 0:
        pass
    elif int(a[-1]) <= m:
        flag = False
        m = int(a[-1])
        min_dish = a
B = [int(i) for i in A]
if flag:
    min_dish = min(B)

sum = int(min_dish)
A.remove(min_dish)
for a in A:
    if int(a[-1]) == 0:
        sum += int(a)
    else:
        sum += int(a) + int(10) - int(a[-1])
print(int(sum))

Submission status: Runtime Error

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

b = []

for i in a:
    n = i % 10
    b.append(n)

c = [i for i in b if i > 0]
c.sort()

sum = 0
for j in a:
  sum += j
 
n = 0
for k in c:
    n += 10 - k

N = sum + n + (c[0] - 10)
print(N)

Submission status: Runtime Error

Solution code:
import numpy as np
import math

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

#１の位が0以外でより小さい値のものを最後にする
dishes=np.array([A,B,C,D,E])
dishes_1=np.array(list(map(lambda x: x%10, dishes)))
# print(dishes)
# print(dishes_1)
last=0
ans=0
if np.all(dishes_1==0):
  print("")
else:
  dishes=np.stack([dishes, dishes_1], 1)
  dishes=sorted(dishes, key=lambda x: x[1])
  for i in range(len(dishes)):
      if dishes[i][1]!=0:
          last=dishes[i]
          dishes.pop(i)
          break
  for j in range(len(dishes)):
      ans=ans+dishes[j][0]+((10-dishes[j][0]%10)%10)
  print(ans+last[0])

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)]
l = n - m
print(sum(l)+min(m))

Submission status: Runtime Error

Solution code:
input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
 
min_list = [a,b,c,d,e]
 
minute = 0
for i in range(len(min_list-1)):
    if (min_list[i]%10)==0:
        minute += min_list[i]
    else:
        minute = 10-(min_list[i]%10)+min_list[i]

minute += min_list[4]
 
print(minute)

Submission status: Runtime Error

Solution code:
# coding: utf-8

import numpy as np
import math

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

#１の位が0以外でより小さい値のものを最後にする
dishes=np.array([A,B,C,D,E])
dishes_1=np.array(list(map(lambda x: x%10, dishes)))
# print(dishes)
# print(dishes_1)
last=0
ans=0
if np.all(dishes_1==0):
  print(A+B+C+D+E)
else:
  dishes=np.stack([dishes, dishes_1], 1)
  dishes=sorted(dishes, key=lambda x: x[1])
  for i in range(len(dishes)):
      if dishes[i][1]!=0:
          last=dishes[i]
          dishes.pop(i)
          break
  for j in range(len(dishes)):
      ans=ans+dishes[j][0]+((10-dishes[j][0]%10)%10)
  print(ans+last[0])

Submission status: Runtime Error

Solution code:
a = []
zero = 0

am = 0
am_big = 0

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

    am = x%10


    if(am_big < am):
        am_big = am
        am_big_key = i

    if(am == 0):
        b.append(0)
        zero += 1
    elif(am > 5):
        b.append(5-x%5)
    else:
        b.append(10 - am)
    b.append(x)
    a.append(b)

sum = 0
sum = a[am_big_key][1] +a[am_big_key][0]

a.pop(am_big_key)

if(zero>0):
    a = sorted(a)
else:
    a = sorted(a, reverse=True)



for i in range(len(a)-1):


    if(int(a[i][0]) == 0):
        sum += a[i][1]
    else:
        sum += a[i][1] + a[i][0]

sum += a[i+1][1]




print(sum)

Submission status: Runtime Error

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

order_digit = [i%10 for i in order]
if order_digit == [0,0,0,0,0]:
  print (time-10+min_digit)
else:
  for i in range(len(order)):
    digit = order[i]%10
    if min_digit>=digit and digit!=0:
    min_digit=digit

Submission status: Runtime Error

Solution code:
li = [str(input()) for i in range(5)]
tmp = []
tmp_2 = []
s = 0
for i in range(5):
    if 10-int(li[i][-1]) != 10:
        tmp.append(10-int(li[i][-1]))
    tmp_2.append(int(li[i]))
tmp.sort()
print(sum(tmp_2)+(sum(tmp)-tmp[-1]))

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python

A = [input() for i in range(5)]
min = 9
for a in A:
    if int(a[-1]) <= min and int(a[-1]) != 0:
        min = int(a[-1])
        min_dish = a
sum = int(min_dish)
A.remove(min_dish)
for a in A:
    if a[-1] == '0':
        sum += int(a)
    else:
        sum += int(a) + int(10) - int(a[-1])
print(int(sum))

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
import numpy as np
import math
#１の位が0以外でより小さい値のものを最後にする
dishes=np.array([A,B,C,D,E])
dishes_1=np.array(list(map(lambda x: x%10, dishes)))
# print(dishes)
# print(dishes_1)
last=0
ans=0
if np.all(dishes_1==0):
  print(A+B+C+D+E)
else:
  dishes=np.stack([dishes, dishes_1], 1)
  dishes=sorted(dishes, key=lambda x: x[1])
  for i in range(len(dishes)):
      if dishes[i][1]!=0:
          last=dishes[i]
          dishes.pop(i)
          break
  for j in range(len(dishes)):
      ans=ans+dishes[j][0]+((10-dishes[j][0]%10)%10)
  print(ans+last[0])

Submission status: Runtime Error

Solution code:
A = [input() for i in range(5)]
min = 9
min_dish = ''
for a in A:
    if int(a[-1]) < min and int(a[-1]) != 0:
        min = int(a[-1])
        min_dish = a
sum = int(min_dish)
A.remove(min_dish)
for a in A:
    if a[-1] == '0':
        sum += int(a)
    else:
        sum += int(a) + int(10) - int(a[-1])
print(int(sum))

Submission status: Runtime Error

Solution code:
times = [int(input()) for i in range(5)]
summ = sum(times)

time = times[:]

for i in range(5):
  while time[i] - 10 >= 0:
    time[i] -= 10

unko = [10-i for i in time]

while 10 in unko:
  unko.remove(10)

unko.remove(max(unko))

print(summ+sum(unko))

Submission status: Runtime Error

Solution code:
menu = [0]*5
md = 300
time = 0
for i in range(5):
    menu[i] = int(input())
for i in range(5):
    huga = menu[i]%10
    if((huga<md)and(huga!=0)):
        x = menu[i]
        md = menu[i]%10
        index = i
#        print(md,index)
menu.pop(index)
for i in range(4):
    hoge = menu[i] % 10
    if hoge != 0:
        time = time + menu[i] + (10 - hoge)
    else:
        time = time + menu[i]

time  = time + x
print(time)

Submission status: Runtime Error

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

def ceil(src, range):
    return ((int)(src / range) + 1 ) * range

x1 = [x[i] % 10for i in range(5)]
x2 = [ceil(x[i], 10) for i in range(5)]
x2[skip] = 0
result = sum(x2) + last

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=x
for n in l10:
    res.remove(n)

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

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
Data = [A, B, C, D, E]
a, b, c, d, e =  A % 10, B % 10, C % 10, D % 10, E % 10,
d_data = [a, b, c, d, e]
h = d_data.count(0)
time_data = []
j = 5 - h
while h >= 1:
    i = d_data.index(0)
    time_data.append(Data[i])
    del d_data[i]
    del Data[i]
    h = h - 1
while j >= 2:
    k = d_data.index(max(d_data))
    time_data.append(Data[k] + (10 - d_data[k]))
    del d_data[k]
    del Data[k]
    j = j - 1

time_data.append(Data[0])
print(sum(time_data))

Submission status: Runtime Error

Solution code:
a = []
zero = 0

am = 0
am_big = 0

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

    am = x%10


    if(am_big < am):
        am_big = am
        am_big_key = i

    if(am == 0):
        b.append(0)
        zero += 1
    elif(am > 5):
        b.append(5-x%5)
    else:
        b.append(am)
    b.append(x)
    a.append(b)

sum = 0


#print(a[am_big_key])

sum = a[am_big_key][1] +a[am_big_key][0]


a.pop(am_big_key)

if(zero>0):
    a = sorted(a)
else:
    a = sorted(a, reverse=True)



for i in range(len(a)-1):
    #print(a[i])

    if(int(a[i][0]) == 0):
        sum += a[i][1]
    else:
        sum += a[i][1] + a[i][0]

sum += a[i+1][1]




print(sum)

Submission status: Runtime Error

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

dic = {"A":A,"B":B,"C":C,"D":D,"E":E}

arr1 = []
arr2 = []
res = 0

for k,v in dic.items():
    if v % 10 != 0:
        arr1.append((int(v / 10) + 1 ) * 10 - v)
    res += v

fraction = sum(arr1)     
for i in arr1:
    arr2.append(fraction - i)

print(res + min(arr2))

Submission status: Runtime Error

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

g = []
g.append(a)
g.append(b)
g.append(c)
g.append(d)
g.append(e)

G = []

A=a%10
B=b%10
C=c%10
D=d%10
E=e%10

G.append(A)
G.append(B)
G.append(C)
G.append(D)
G.append(E)

min_except0 = G

for i in range(4):
  min_except0.remove(0)

x = G.index(min(min_except0))

loop = [0,1,2,3,4]
loop.remove(x)

answer = 0
for i in loop:
  answer += g[i]
  answer += 10-G[i]
answer += g[x]

print(answer)

Submission status: Runtime Error

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

min_list = [a,b,c,d,e]
amari_list = [(a%10),(b%10),(c%10),(d%10),(e%10)]
amari_list.sort()

minute = 0
for i in range(ren(amari_list)):
    if (amari_list[i]%10)==0:
        minute += amari_list[i]
    else:
        minute = 10-(amari_list[i]%10)+amari_list[i]

print(minute)


min_value = [i for i, x in enumerate(amari_list) if x == amari_min]

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
import numpy as np
import math
#１の位が0以外でより小さい値のものを最後にする
dishes=np.array([A,B,C,D,E])
dishes_1=np.array(list(map(lambda x: x%10, dishes)))
# print(dishes)
# print(dishes_1)
last=0
ans=0
if np.all(dishes_1==0):
  print(A+B+C+D+E)
else:
  dishes=np.stack([dishes, dishes_1], 1)
  dishes=sorted(dishes, key=lambda x: x[1])
  print(dishes)
  for i in range(len(dishes)):
      if dishes[i][1]!=0:
          last=dishes[i]
          dishes.pop(i)
          break
  for j in range(len(dishes)):
      ans=ans+dishes[j][0]+((10-dishes[j][0]%10)%10)
  print(ans+last[0])

Submission status: Runtime Error

Solution code:
l=[input() for i in range(5)]
a=[0, 0, 0, 0, "9"]

for i in range(5):
  if int(a[4][-1]) >= int(l[i][-1]) and not(int(l[i][-1]) == 0):
      a[4] = l[i]

if a[4] is 0:
  a[4] = l[0]

l.remove(a[4])
l = [int(i) for i in l]
l.sort()
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()) for i in range(5)]
r = 10
last = 10000
for i in range(5):
    if a[i] % 10 != 0 and a[i] % 10 < r:
        last = i
        r = int(a[i] % 10)

if last == 10000:
    for i in range(5):
        time = time + a[i]

else:
    b = [int((a[i] + 9) / 10) * 10 for i in range(5)] 
    time = 0
    for i in range(5):
        if i != last:
            time = time + b[i]
    
    time = time + a[last]
    print(time)

Submission status: Runtime Error

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

AA = int(A)
BB = int(B)
CC = int(C)
DD = int(D)
EE = int(E)

a = A[-1]
b = B[-1]
c = C[-1]
d = D[-1]
e = E[-1]

aa = int(a)
bb = int(b)
cc = int(c)
dd = int(d)
ee = int(e)

data = [aa ,bb, cc, dd, ee]
def func(x):
    if(x==0): return False
    else: return True
    
filtered = filter(func, data)

kk =min (filtered)
n = int(0)

if aa == 0 :
    n = n+AA
else:
    n = n+AA+10-aa
if bb == 0 :
    n = n+BB
else:
    n = n+BB+10-bb
if cc == 0 :
    n = n+CC
else:
    n = n+CC+10-cc
if dd == 0 :
    n = n+DD
else:
    n = n+DD+10-dd
if ee == 0 :
    n = n+EE
else:
    n = n+EE+10-ee
print(n+kk-10)

Submission status: Runtime Error

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

if last == 10000:
    for i in range(5):
        time = time + a[i]

else:
    b = [int((a[i] + 9) / 10) * 10 for i in range(5)] 
    time = 0
    for i in range(5):
        if i != last:
            time = time + b[i]
    
    time = time + a[last]
    print(time)

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())
ls=[a,b,c,d,e]
ls_1=[]
for i in range(len(ls)):
    ls_1.append(int(str(ls[i])[-1]))
ls_1=np.array(ls_1)
ls_1=10-ls_1
ls_1_10=ls_1[ls_1 < 10]#１０を除いたロス
a=np.argmax(ls_1_10)#最大の１の位を探す
ls_non=np.delete(ls_1_10, a, 0)
#ls_non_10=ls_non[ls_non < 10]
ls=np.array(ls)
ans=np.sum(ls) + np.sum(ls_non)
print(ans)

Submission status: Runtime Error

Solution code:
import sys
import numpy as np

a_t=int(input())
b_t=int(input())
c_t=int(input())
d_t=int(input())
e_t=int(input())

a_d = a_t % 10
b_d = b_t % 10
c_d = c_t % 10 
d_d = d_t % 10
e_d = e_t % 10

dish_d = np.zeros(5)
dish_d[0] = a_d
dish_d[1] = b_d
dish_d[2] = c_d
dish_d[3] = d_d
dish_d[4] = e_d

time = (
        a_t // 10 + np.where(a_d==0, 0, 1) \
        + b_t  // 10 + np.where(b_d==0, 0, 1) \
        + c_t // 10 + np.where(c_d==0, 0, 1) \
        + d_t // 10 + np.where(d_d==0, 0, 1) \
        + e_t // 10 + + np.where(e_d==0, 0, 1)
       ) * 10 - (10 - np.min(dish_d[np.nonzero(dish_d)]))
print(int(time))

Submission status: Runtime Error

Solution code:
E = input()

AA = int(A)
BB = int(B)
CC = int(C)
DD = int(D)
EE = int(E)

a = A[-1]
b = B[-1]
c = C[-1]
d = D[-1]
e = E[-1]

aa = int(a)
bb = int(b)
cc = int(c)
dd = int(d)
ee = int(e)

data = [aa ,bb, cc, dd, ee]
def func(x):
    if(x==0): return False
    else: return True
    
filtered = filter(func, data)

kk =min (filtered)
n = int(0)

if aa == 0 :
    n = n+AA
else:
    n = n+AA+10-aa
if bb == 0 :
    n = n+BB
else:
    n = n+BB+10-bb
if cc == 0 :
    n = n+CC
else:
    n = n+CC+10-cc
if dd == 0 :
    n = n+DD
else:
    n = n+DD+10-dd
if ee == 0 :
    n = n+EE
else:
    n = n+EE+10-ee
print(n+kk-10)

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]
h = 0
j =[]
for i in range(0, 5):
    f = l[i] // 10
    g = l[i] % 10
    if not(g == 0):
        f = f + 1
        j.append(g)
    f = f * 10
    h = h + f
    
if not(g == []):
    h = h + min(j) -10
print(h)

Submission status: Runtime Error

Solution code:
menu = [0]*5
md = 300
time = 0
for i in range(5):
    menu[i] = int(input())
for i in range(5):
    if(((menu[i]%10)<md)and(menu[i]%10)!=0):
        x = menu[i]
        md = menu[i]%10
        index = i
#        print(md,index)
menu.pop(index)
for i in range(4):
    hoge = menu[i] % 10
    if hoge != 0:
        time = time + menu[i] + (10 - hoge)
    else:
        time = time + menu[i]

time  = time + x
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())
if a >= 100:
    a1 = a % 10
else:
    a2 = a - 100
    a1 = a2 % 10
if b >= 100:
    b1 = b % 10
else:
    b2 = b - 100
    b1 = b2 % 10
if c >= 100:
    c1 = c % 10
else:
    c2 = c - 100
    c1 = c2 % 10
if d >= 100:
    d1 = d % 10
else:
    d2 = d - 100
    d1 = d2 % 10
if e >= 100:
    e1 = e % 10
else:
    e2 = e - 100
    e1 = e2 % 10
if a1 == 0:
    a1 = 9
if b1 == 0:
    b1 = 9
if c1 == 0:
    c1 = 9
if d1 == 0:
    a1 = 9
if e1 == 0:
    e1 = 9
lis = [a1,b1,c1,d1,e1]
if a1 == min(lis) :
    answer = math.ceil(b / 10) * 10 + math.ceil(c/ 10) * 10 + math.ceil(e/ 10* 10+ math.ceil(d/ 10 * 10 + a
if b1 == min(lis):
    answer = math.ceil(a/ 10)* 10 + math.ceil(c/ 10)* 10 + math.ceil(e/ 10)* 10 + math.ceil(d/ 10)* 10 + b
if c1 == min(lis):
    answer = math.ceil(b/ 10)* 10 + math.ceil(a/ 10)* 10 + math.ceil(e/ 10)* 10 + math.ceil(d/ 10)* 10 + c
if d1 == min(lis):
    answer = math.ceil(b/ 10)* 10 + math.ceil(c/ 10)* 10 + math.ceil(e/ 10)* 10 + math.ceil(a/ 10)* 10 + d
if e1 == min(lis):
    answer = math.ceil(b/ 10)* 10 + math.ceil(c/ 10)* 10 + math.ceil(e/ 10)* 10 + math.ceil(a/ 10)* 10 + e
print(answer)

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)

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

Submission status: Runtime Error

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

#menu=[int(a[-1]),int(b[-1]),int(c[-1]),int(d[-1]),int(e[-1])]
menu=[a[-1],b[-1],c[-1],d[-1],e[-1]]
menu.sort()
while menu[0]=="0":
    menu.remove("0")
iti=int(menu[0])

marume=10 * (len(menu)-1)


time=0
kuso=[a,b,c,d,e]

for temp in kuso:
    if len(temp)==2:
        time+=int(temp[-2])*10
    elif len(temp)==3:
        time+=100 + 10*int(temp[-2])
    else:
        time+=0
        
print(iti + marume +time)

Submission status: Runtime Error

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

mod_list = []

a_mod = a % 10
if a_mod == 0:
    a_total = a
else:
    a_total = a + (10 - a_mod)
    mod_list.append(a_mod)

b_mod = b % 10
if b_mod == 0:
    b_total = b
else:
    b_total = b + (10 - b_mod)
    mod_list.append(b_mod)

c_mod = c % 10
if c_mod == 0:
    c_total = c
else:
    c_total = c + (10 - c_mod)
    mod_list.append(c_mod)

d_mod = d % 10
if d_mod == 0:
    d_total = d
else:
    d_total = d + (10 - d_mod)
    mod_list.append(d_mod)

e_mod = e % 10
if e_mod == 0:
    e_total = e
else:
    e_total = e + (10 - e_mod)
    mod_list.append(e_mod)

min_mod = 0
min_mod = min(mod_list)

if min_mod == 0:
    cut_time = 0
else:
    cut_time = 10 - min(mod_list)

print(a_total + b_total + c_total + d_total + e_total - cut_time)

Submission status: Runtime Error

Solution code:
def solve():
    time_dish=[0]*5
    for i in range(5):
        time_dish[i]=int(input())
    time=0
    x=10
    for i in range(5):
        #if time_dish[i]%10 != 10:
        time += math.ceil(time_dish[i]/10)*10
        if (time_dish[i]%10 != 0) and (x > time_dish[i]%10):
            x = time_dish[i]%10
    print(time-10+x)

solve()

Submission status: Runtime Error

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

a = A % 10
b = B % 10
c = C % 10
d = D % 10
e = E % 10

if a == 0:
  a = 10
elif b == 0:
  b = 10
elif c == 0:
  c = 10
elif d == 0:
  d = 10
elif e = 10:
  e = 10
  
list1 = [a,b,c,d,e]
list1.sort(reverse = True)
key = {a:A,b:B,c:C,d:D,e:E}
i = 0
sum = 0
while i < 4:
  sum += key[list1[i]]
  while not sum % 10 == 0:
    sum += 1
  i += 1
  
sum += list1[4]
print(sum)

Submission status: Runtime Error

Solution code:
a = []
for i in range(5):
  num = input()
  a.append(num)
if int(a[0][2]) <= int(a[1][2]) and int(a[0][2]) <= int(a[2][2]) and int(a[0][2]) <= int(a[3][2]) and int(a[0][2]) <= int(a[4][2]):
  b = int(a[1]) + 10-int(a[1][2]) + int(a[2]) + 10-int(a[2][2]) + int(a[3]) + 10-int(a[3][2]) + int(a[4]) + 10-int(a[4][2]) + int(a[0])
  print(b)
elif int(a[1][2]) <= int(a[0][2]) and int(a[1][2]) <= int(a[2][2]) and int(a[1][2]) <= int(a[3][2]) and int(a[1][2]) <= int(a[4][2]):
  b = int(a[0]) + 10-int(a[0][2]) + int(a[2]) + 10-int(a[2][2]) + int(a[3]) + 10-int(a[3][2]) + int(a[4]) + 10-int(a[4][2]) + int(a[1])
  print(b)
elif int(a[2][2]) <= int(a[0][2]) and int(a[2][2]) <= int(a[1][2]) and int(a[2][2]) <= int(a[3][2]) and int(a[2][2]) <= int(a[4][2]):
  b = int(a[0]) + 10-int(a[0][2]) + int(a[1]) + 10-int(a[1][2]) + int(a[3]) + 10-int(a[3][2]) + int(a[4]) + 10-int(a[4][2]) + int(a[2])
  print(b)
elif int(a[3][2]) <= int(a[0][2]) and int(a[3][2]) <= int(a[1][2]) and int(a[3][2]) <= int(a[2][2]) and int(a[3][2]) <= int(a[4][2]):
  b = int(a[0]) + 10-int(a[0][2]) + int(a[1]) + 10-int(a[1][2]) + int(a[2]) + 10-int(a[2][2]) + int(a[4]) + 10-int(a[4][2]) + int(a[3])
  print(b)
elif int(a[4][2]) <= int(a[0][2]) and int(a[4][2]) <= int(a[1][2]) and int(a[4][2]) <= int(a[2][2]) and int(a[4][2]) <= int(a[3][2]):
  b = int(a[0]) + 10-int(a[0][2]) + int(a[1]) + 10-int(a[1][2]) + int(a[2]) + 10-int(a[2][2]) + int(a[3]) + 10-int(a[3][2]) + int(a[4])
  print(b)

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()) for i in range(5)]
r = 10
last = 10000
for i in range(5):
    #if a[i] % 10 == 0:
    #    fix = i
    if a[i] % 10 != 0 and a[i] % 10 < r:
        last = i
        r = int(a[i] % 10)

if last == 10000:
    for i in range(5):
        time = time + a[i]
    print(time)

else:
    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]
    print(time)

Submission status: Runtime Error

Solution code:
b=10
sum=0
for _ in range(5):
	a=int(input())
    sum+=a-a%10
  	if b>a:
      b=a
sum+=40+b
print(sum)

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