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:
S = [int(input()) for _ in range(5)]
l=[]
m=10
for i in range(5):
    if (S[i]%10)<m and S[i]%10!=0:
        m=S[i]%10
        a=S[i]
        j=i
for i in range(5):
    if  i!=j:
        if S[i]%10!=0:
            S[i]+=10-(S[i]%10)
        l.append(S[i])
l.append(a)
print(sum(l))

Submission status: Runtime Error

Solution code:
l = []
for i in range(5):
    l.append(int(input()))
amari = []
for i in range(5):
    amari.append(10-l[i]%10)
jikan = []
for i in range(5):
    jikan.append(l[i] + amari[i])
print(sum[jikan]-max(amari))

Submission status: Runtime Error

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

print(sum(a) + sum(b) - max(b))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

num_list = [a, b, c, d, e]
last_digit = []
for i in num_list:
    d = str(i)
    digit = d[-1]
    digit = int(digit)
    last_digit.append(digit)

min = 10000
for j in last_digit:
    if j < min and j != 0:
        min = j
last_digit[last_digit.index(min)] = 0

for k in range(len(num_list)):
    if last_digit[k] != 0:
        num_list[k] += 10-last_digit[k]

ans = 0
for l in num_list:
    ans += l

print(ans)

Submission status: Runtime Error

Solution code:
from math import ceil
time=[int(input())for i in range(5)]
mod=[i%10 for i in time]
a=124
res=0
for i in range(len(mod)):
    if mod[i] !=0:
        a=min(a,mod[i])
for i in range(5):
    if i==mod.index(a):
        res+=time[i]
    else:
        res+=ceil(time[i]/10)*10
print(res)

Submission status: Runtime Error

Solution code:
M = 0
ans = 0
for i in range(5):
  a = append(int(input()))
  b = ((a + 9) // 10) * 10
  M = max(M, b-a)
  ans += b
print(ans - M)

Submission status: Runtime Error

Solution code:
x = [int(input()) for i in range(5)]
a=[]
for i in x:
  a.append(i%10)
while 0 in a:
  a.remove(0)
b=sorted(a)
y=0
for i in x:
  if i%10==0:
    y+=i
  else:
    y+=(i+(10-(i%10)))
print(y-(10-b[0]))

Submission status: Runtime Error

Solution code:
sum = 0
r =[]
for i in range(5):
  if a[i] % 10 ==0:
    sum+=a[i]
  elif a[i] % 10 !=0:
    sum+= (10*math.ceil(a[i]/10))
    r.append(int(a[i]%10))
print(sum-10+min(r))

Submission status: Runtime Error

Solution code:
import math
a = [int(input()) for i in range(5)]
sum = 0
r =[]
for i in range(5):
  if a[i] % 10 ==0:
    sum+=a[i]
  elif a[i] % 10 !=0:
    r.append(a[i]%10)
    sum+= (10*math.ceil(a[i]/10))
print(sum-10+min(r))

Submission status: Runtime Error

Solution code:
import math
a = [int(input()) for i in range(5)]
sum = 0
r =[]
for i in range(5):
  if a[i] % 10 =0:
    sum+=a[i]
  elif a[i] % 10 !=0:
    r.append(a[i]%10)
    sum+= (math.ceil(a[i]/10)*10)
print(sum-10+min(r))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

min=9

for i in range(5):
    if min> li[i]%10 >0:
        min=li[i]%10
        min_f=i

cnt=0

for i in range(5):
    if i==min_f:
        continue
    if li[i]%10==0:
        cnt+=li[i]
    else:
        cnt+=li[i]+10-li[i]%10
print(cnt+li[min_f])

Submission status: Runtime Error

Solution code:
menu = [int(input()) for i in range(5)]
def kuriage(n):
    if n %10 == 0:
        return 0
    else:
        return 10-(n %10)
ans = 0
mini = 10
for i in range(5):
    if menu[i] %10 < mini and menu[i]%10 !=0:
        mini = menu[i] %10
        k = i
for i in range(5):
    if i == k:
        menu[i], menu[-1] = menu[-1], menu[i]

for i in range(5):
    if i != 4:
        ans += menu[i] + kuriage(menu[i])
    else:
        ans += menu[-1]
        print(ans)

Submission status: Runtime Error

Solution code:
import math
ans=0
A=[int(input()) for i in range(5)]
a=0
for i in range(5):
  if (A[i]%10)>a:
    p=i
    a=A[i]
for i in range(5):
  if i==p:
    ans+=A[i]
  else:
    ans+=10*(math.ceil(A[i]/10))
print(ans)

Submission status: Runtime Error

Solution code:
import math
ans=0
A=[int(input()) for i in range(5)]
a=10
for i in range(5):
  if a>A[i]:
    p=i
    a=A[i]
for i in range(5):
  if i==p:
    ans+=A[i]
  else:
    ans+=10*(math.ceil(A[i]/10))
print(ans)

Submission status: Runtime Error

Solution code:
w = [str(input()) for i in range(5)]
num = ['0','9','8','7','6','5','4','3','2','1']
w1 = []
m = 0
t = 0
for h in w:
    for j in num:
        if h[-1] == j:
            w1.append(int(h)+num.index(j))
            if m < num.index(j):
                m = num.index(j)
                k = w.index(h)
for l in range(5):
    if l != k:
        t += w1[l]
print(t+int(w[k]))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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:
    a = 0
else:
    a = 10 - A % 10

if B % 10 == 0:
    b = 0
else:
    b = 10 - B % 10

if C % 10 == 0:
    c = 0
else:
    c = 10 - C % 10

if D % 10 == 0:
    d = 0
else:
    d = 10 - D % 10

    if E % 10 == 0:
        e = 0
    else:
        e = 10 - E % 10

sum = A + B + C + D + E + a + b + c + d + e - max(a,b,c,d,e)

print(sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = 0
for x in X:
    n = x + 9
    ans += n - n % 10
ans -= 10 - min([x % 10 for x in X if x % 10 != 0])
print(ans)

Submission status: Runtime Error

Solution code:
import sys
input=sys.stdin.read
*x,=map(int, input().split("\n"))
tmp=100
for i in range(5):
    if x[i]%10:
        tmp = min(tmp,x[i]%10)
        x[i]//=10
        x[i]*= 10
        x[i]+=10
ans= sum(x)
if tmp<100:
    ans-=10
    ans+=tmp
print(ans)

Submission status: Runtime Error

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

r = []

if A%10 != 0:
    r.append(10 - A%10)
    A += 10 - A%10
if B%10 != 0:
    r.append(10 - B%10)
    B += 10 - B%10
if C%10 != 0:
    r.append(10 - C%10)
    C += 10 - C%10
if D%10 != 0:
    r.append(10 - D%10)
    D += 10 - D%10
if E%10 != 0:
    r.append(10 - E%10)
    E += 10 - E % 10

print(A+B+C+D+E-max(r))

Submission status: Runtime Error

Solution code:
import math
abc = [int(input()) for _ in range(5)]
tmp = 9
ans = 0
for i in range(5):
    tmpp = min(tmp, (abc[i]-1)%10)
    if tmp != tmpp:
        tmp = tmpp
        ii = i
for i in range(5):
    if i == ii:
        ans += abc[i]
    else:
        ans += (math.ceil(abc[i]/10))*10
print(ans)

Submission status: Runtime Error

Solution code:
a = []
b = [0]
ans = 0

for i in range(5):
    A = int(input())
    B = A % 10
    if B != 0:
        A = A + (10 - B)
        b.append(B)
    a.append(A)
if sorted(set(b))[1]:
    ans = sum(a) - (10 - sorted(set(b))[1])
else:
    ans = sum(a)

print(ans)

Submission status: Runtime Error

Solution code:
a = []
b = [0]
ans = 0

for i in range(5):
    A = int(input())
    B = A % 10
    if B != 0:
        A = A + (10 - B)
        b.append(10 - B)
    a.append(A)
ans = sum(a) - sorted(set(b))[-2]
print(ans)

Submission status: Runtime Error

Solution code:
a = []
b = [0]
ans = 0

for i in range(5):
    A = int(input())
    B = A % 10
    if B != 0:
        A = A + (10 - B)
        b.append(B)
    a.append(A)
ans = sum(a) - (10 - sorted(set(b))[1])
print(ans)

Submission status: Runtime Error

Solution code:
a=[]
b=[]
ori=[]
ans=0
for i in range(5):
  c=int(input())
  ori.append(c)
  a.append((c//10+1)*10)
  
  if c%10==0:
    b.append(100)
  else:
    b.append(c%10)
a.pop(b.index(min(b)))
print(ori[b.index(min(b))]+a.sum())

Submission status: Runtime Error

Solution code:
list1 = []
for i in range(5):
  a = input()
  b = int(a[-1])
  c = int(a)
  list1.append((b,c))
aaa = sorted(list1)

mini = []
total = 0
for i in range(5):
  if aaa[i][0] != 0:
    mini = aaa[i]
    
    a = aaa.pop(i)
    break

for i in aaa:
  if i[0] != 0:
    d = 10 - i[0]
    ans = i[1] + d
  else:
    ans = i[1]
  total += ans

total += mini[1]
print(total)

Submission status: Runtime Error

Solution code:
n=[int(input()) for _ in range(5)];m=10-min([i%10 for i in n if i%10!=0])
n=[i if i%10==0 else i+(10-i%10) for i in n]
print(sum(n)-m)

Submission status: Runtime Error

Solution code:
nums = [int(input()) for _ in range(5)]
mn = float('inf')

for i in nums:
    if i%10!=0:
        mn = min(mn, i%10)
if mn == float('inf'):
    mn = 0

print(sum(list(map(lambda x: int(math.ceil(x/10)*10), nums)))-10+mn)

Submission status: Runtime Error

Solution code:
dish = [int(input()) for d in range(5)]
tmp = 0
time = []
for index,d in enumerate(dish):
  if d % 10 != 0:
    d10 = ((d // 10) +1) * 10
    time.append(d10)
    if tmp <= (d10-d):
      tmp = d10 - d
      last = index  
  else:
    time.append(d)
del time[last]
print(sum(time)+dish[last])

Submission status: Runtime Error

Solution code:
# abc123_b.py
# https://atcoder.jp/contests/abc123/tasks/abc123_b

# B - Five Dishes /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点: 200点

# 問題文
# AtCoder 料理店では、以下の 5つの料理が提供されています。ここで、「調理時間」は料理を注文してから客に届くまでの時間とします。
#     ABC 丼： 調理時間 A分
#     ARC カレー： 調理時間 B分
#     AGC パスタ： 調理時間 C分
#     APC ラーメン： 調理時間 D分
#     ATC ハンバーグ： 調理時間 E分

# また、この店には以下のような「注文のルール」があります。
#     注文は、10の倍数の時刻 (時刻 0,10,20,30,...) にしかできない。
#     一回の注文につき一つの料理しか注文できない。
#     ある料理を注文したら、それが届くまで別の注文ができない。ただし、料理が届いたちょうどの時刻には注文ができる。

# E869120 君は時刻 0に料理店に着きました。彼は 5 つの料理全てを注文します。最後の料理が届く最も早い時刻を求めてください。
# ただし、料理を注文する順番は自由であり、時刻 0に注文することも可能とであるとします。

# 制約
#     A,B,C,D,Eは 1 以上 123以下の整数

# 入力
# 入力は以下の形式で標準入力から与えられる。
# A
# B
# C
# D
# E

# 出力
# 最後の料理が届く最も早い時刻を整数で出力せよ。

# 入力例 1
# 29
# 20
# 7
# 35
# 120

# 出力例 1
# 215

# ABC 丼→ARC カレー→AGC パスタ→ATC ハンバーグ→APC ラーメン の順に注文することにすると、各料理の最も早い注文時刻・届く時刻は以下の通りになります。

#     時刻 0に ABC 丼を注文する。時刻 29に ABC 丼が届く。
#     時刻 30に ARC カレーを注文する。時刻 50に ARC カレーが届く。
#     時刻 50に AGC パスタを注文する。57に AGC パスタが届く。
#     時刻 60に ATC ハンバーグを注文する。時刻 180に ATC ハンバーグが届く。
#     時刻 180に APC ラーメンを注文する。時刻 215に APC ラーメンが届く。

# これより早く最後の料理が届くような方法は存在しません。

# 入力例 2
# 101
# 86
# 119
# 108
# 57

# 出力例 2
# 481

# AGC パスタ→ARC カレー→ATC ハンバーグ→APC ラーメン→ABC 丼の順に注文することにすると、各料理の最も早い注文時刻・届く時刻は以下の通りになります。

#     時刻 0に AGC パスタを注文する。時刻 119に AGC パスタが届く。
#     時刻 120に ARC カレーを注文する。時刻 206に ARC カレーが届く。
#     時刻 210に ATC ハンバーグを注文する。時刻 267に ATC ハンバーグが届く。
#     時刻 270に APC ラーメンを注文する。時刻 378に APC ラーメンが届く。
#     時刻 380に ABC 丼を注文する。時刻 481に ABC 丼が届く。

# これより早く最後の料理が届くような方法は存在しません。

# 入力例 3
# 123
# 123
# 123
# 123
# 123

# 出力例 3
# 643

# これが入力される最大のケースです。 


def log(line):
    if False:
        print(line)


def calculation(lines):
    # line = lines[0]
    # N = int(lines[0])
    # N, Q = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[1].split()))
    values = list()
    for i in range(5):
        values.append(int(lines[i]))
    # valueses = list()
    # for i in range(Q):
    #     valueses.append(list(map(int, lines[i+1].split())))

    su = 0
    amaris = list()

    for value in values:
        amari = value % 10
        if amari > 0:
            amaris.append(10-amari)

    return [sum(values) + sum(amaris) - max(amaris)]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['29', '20', '7', '35', '120']
        lines_export = [215]
    if pattern == 2:
        lines_input = ['101', '86', '119', '108', '57']
        lines_export = [481]
    if pattern == 3:
        lines_input = ['123', '123', '123', '123', '123']
        lines_export = [643]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(5)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
# B - Five Dishes
import numpy as np
n=[]
for i in range(5):
    t = int(input())
    n.append(t)
n = np.array(n)
dl = [0]
m = [e for e in n%10 if e not in dl]
s = np.ceil(n/10)*10
print(int(np.sum(s)-(10-min(m))))

Submission status: Runtime Error

Solution code:
# B - Five Dishes
import numpy as np
n=[]
for i in range(5):
    t = int(input())
    n.append(t)
n = np.array(n)

m = [e for e in n%10 if e not in dl]
s = np.ceil(n/10)*10
print(int(np.sum(s)-min(m)))

Submission status: Runtime Error

Solution code:
# B - Five Dishes
import numpy as np
n=[]
for i in range(5):
    t = int(input())
    n.append(t)
n = np.array(n)

m = [e for e in n%10 if e not in dl]
s = np.ceil(n/10)*10
print(int(np.sum(s)-min(m))

Submission status: Runtime Error

Solution code:
# B - Five Dishes
import numpy as np
n=[]
for i in range(5):
    t = int(input())
    n.append(t)
n = np.array(n)

m = [e for e in n%10 if e not in dl]
s = np.ceil(n/10)*10
print(np.sum(s)-min(m))

Submission status: Runtime Error

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

def roundup(n):
    return int(math.ceil(n /10)) * 10
def get_digit(number):
    return number % 10   
s = 0
m = []
li = [A, B, C, D, E]
for i in range(len(li)):
    if get_digit(li[i]) >= 1:
        m.append(get_digit(li[i]))
f = False
        
for l in range(len(li)):
    if min(m) == get_digit(li[l]) and f == False:
        s += li[l]
        f = True
    else:
        s += roundup(li[l])
print(s)

Submission status: Runtime Error

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

def roundup(n):
    return int(math.ceil(n /10)) * 10
def get_digit(number):
    return number // 10**0 % 10   
s = 0
m = []
li = [A, B, C, D, E]
for i in range(len(li)):
    if get_digit(li[i]) >= 1:
        m.append(get_digit(li[i]))
f = False
        
for l in range(len(li)):
    if min(m) == get_digit(li[l]) and f == False:
        s += li[l]
        f = True
    else:
        s += roundup(li[l])
print(s)

Submission status: Runtime Error

Solution code:
dish = [int(input()) for i in range(5)]
a = [i%10 for i in dish]
x=10
for i in a:
  if i>0:
    x=min(x,i)
y = a.index(x)
l = dish.pop(y)

time = [(i//10+1)*10  if i%10 != 0 else i for i in dish ]

ans = sum(time) + l
print(ans)

Submission status: Runtime Error

Solution code:
import math

lst = []
min_1 = "129"
for i in range(5):
    s = input()
    lst.append(s)
    if s[-1] != "0" and s[-1] <= min_1[-1]:
        min_1 = s
lst.remove(min_1)
a = list(map(lambda x:math.ceil(int(x)/10)*10,lst))
print(sum(a) + int(min_1))

Submission status: Runtime Error

Solution code:
import math

lst = []
min_1 = "9"
for i in range(5):
    s = input()
    lst.append(s)
    if s[-1] != "0" and s[-1] < min_1[-1]:
        min_1 = s
lst.remove(min_1)
a = list(map(lambda x:math.ceil(int(x)/10)*10,lst))
print(sum(a) + int(min_1))

Submission status: Runtime Error

Solution code:
l=[]
m=[]
for i in range(5):
  i = int(input())
  k = 10 - (i%10)
  l.append(i)
  if k != 10:
    m.append(k)
m.sort()
s = sum(m)-m[-1]
print(sum(l)+s)

Submission status: Runtime Error

Solution code:
l=[]
m=[]
for i in range(5):
  i = int(input())
  k = 10 - (i%10)
  l.append(i)
  if k != 10:
    m.append(k)
m.sort()
s = sum(m)-m[4]
print(sum(l)+s)

Submission status: Runtime Error

Solution code:
#38
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
last = 9
time = 0
cou = 0
#l = [[A,"A"],[B,"B"],[C,"C"],[D,"D"],[E,"E"]]
l = [A,B,C,D,E]
for i in l:
    if i%10 !=0 :
        if last%10 >= i%10:
            last = i

l.remove(last)
l.append(last)
for i in range(5):
    time += l[i]
    if i == 4:
        break
    while time%10 != 0:
        time += 1
        
    
print(time)

Submission status: Runtime Error

Solution code:
#38
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
last = 9
time = 0
cou = 0
#l = [[A,"A"],[B,"B"],[C,"C"],[D,"D"],[E,"E"]]
l = [A,B,C,D,E]
for i in l:
    if i%10 !=0 :
        if last%10 > i%10:
            last = i

l.remove(last)
l.append(last)
for i in range(5):
    time += l[i]
    if i == 4:
        break
    while time%10 != 0:
        time += 1
        
    
print(time)

Submission status: Runtime Error

Solution code:
lst = [input() for i in range(5)]
d = [int(num) for num in lst]
lst_one = [int(list(i)[-1]) for i in lst]

if lst_one.count(0) == 0:
  idx = lst_one.index(min(lst_one))
else:
  no_zero = [i for i in lst_one if i != 0]
  m = min(no_zero)
  idx = lst_one.index(m)

x = d[idx]
del d[idx]

for i in range(len(d)):
  if d[i] % 10 != 0:
    d[i] = 10*(int((d[i]/10))+1)
  else:
    continue
print(sum(d) + x)

Submission status: Runtime Error

Solution code:
d = [input() for i in range(5)]
p = [int(list(i)[-1]) for i in d]
if p.count(0) == 0:
  n = p.index(min(p))
else:
  q = sorted(p)
  while q.count(0) != 0:
    q.remove(0)
  m = q[0]
  n = p.index(m)
  
x = int(d[n])
del d[n]

for i in range(len(d)):
  if list(d[i])[-1] == "0":
    continue
  else:
    d[i] = int(d[i])
    d[i] = (int(d[i]/10)+1)*10
    
d = [int(num) for num in d]

print(sum(d)+x)

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
result=0
if a==0:
    result+=A
else:
    result+=(A+10-a)
if b==0:
    result+=B
else:
    result+=(B+10-b)
if c==0:
    result+=C
else:
    result+=(C+10-c)
if d==0:
    result+=D
else:
    result+=(D+10-d)
if e==0:
    result+=E
else:
    result+=(E+10-e)

l=set([a,b,c,d,e])
l.discard(0)

print(result-(10-min(l)))

Submission status: Runtime Error

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

li = [ri() for _ in range(5)]
lis = [math.ceil(i/10)*10 for i in li]
ans = inf
for i in range(5):
  ans = min(sum(lis[:i])+li[i]+sum(lis[i+1:]))
print(ans)

Submission status: Runtime Error

Solution code:
dish = [int(input()) for d in range(5)]
diff = 0
ans = []
for index,d in enumerate(dish):
  if d % 10 == 0:
    ans.append(d)
  else:
    d10 = ((d //10) +1) * 10
    ans.append(d10)
    tmp = d10-d
    if diff < tmp:
      diff = tmp
      last= index
    
del ans[last]
print(sum(ans)+dish[last])

Submission status: Runtime Error

Solution code:
dish = [int(input()) for d in range(5)]
diff = 0
ans = []
for index,d in enumerate(dish):
  if d % 10 != 0:
    d10 = ((d //10) +1) * 10
    ans.append(d10)
    if diff < d10-d:
      diff = d10-d
      last= index
  else:
    ans.append(d)
del ans[last]
print(sum(ans)+dish[last])

Submission status: Runtime Error

Solution code:
dish = [int(input()) for d in range(5)]
diff = 0
ans = []
for index,d in enumerate(dish):
  if d % 10 != 0:
    d10 = ((d //10) +1) * 10
    ans.append(d10)
    if diff < d10-d:
      diff = d10-d
      last= index
  else:
    ans.append(d)


ans.remove(ans[last])

print(sum(ans)+dish[last])

Submission status: Runtime Error

Solution code:
dish = [int(input()) for d in range(5)]
diff = 0
ans = []
for index,d in enumerate(dish):
  if d % 10 != 0:
    tmp = (d //10) +1
    d10 = tmp * 10
    ans.append(d10)
  else:
    ans.append(d)
  if d % 10 != 0 and diff < d10-d:
    diff = d10-d
    last= index

ans.remove(ans[last])

print(sum(ans)+dish[last])

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
X=[A%10,B%10,C%10,D%10,E%10]
minimum=100
for i in range(5):
  if X[i]!=0:
    minimum=min(minimum,X[i])
Y=[A,B,C,D,E]
last=X.index(minimum)
time=0
import math
for i in range(5):
  if i!=last:
    time =time+10*math.ceil(Y[i]/10)
if X==[0,0,0,0,0]:
  print(sum(Y))
else:
  print(time+Y[last])

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
X=[A%10,B%10,C%10,D%10,E%10]
minimum=100
for i in range(5):
  if X[i]!=0:
    minimum=min(minimum,X[i])
Y=[A,B,C,D,E]
last=X.index(minimum)
time=0
import math
for i in range(5):
  if i!=last:
    time =time+10*math.ceil(Y[i]/10)
print(time+Y[last])

Submission status: Runtime Error

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

s = []
for i in range(5):
    s.append(t[i] % 10)

p = 10
for i in range(5):
    if s[i] > 0:
        if p > s[i]:
            o = i
            p = s[i]

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

m += t[o]
print(m)

Submission status: Runtime Error

Solution code:
a = []
for i in range(5):
    a.append(int(input()))
x = min(filter(lambda x:x!= 0, map(lambda x:x%10, a)))
b = [(i+9) // 10 *10 for i in a]
print(sum(b) - (10 - x))

Submission status: Runtime Error

Solution code:
import math

li=[int(input()) for _ in range(5)]
m,last,ans=10,li[0],0

for i in range(5):
  l = li[i]
  if 0 < l % 10 < m :
    m = l % 10
    last = l
    lm = i

for i in range(5):
  l=li[i]
  if l == last and i == lm:
    ans += l
  else:
    ans += math.ceil(l/10)*10
    
print(ans)

Submission status: Runtime Error

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

rem = float("inf")
last = 0
for time in times:
    if time % 10 < rem and time % 10 != 0:
        rem = time % 10
        last = time
times.remove(last)

total_time = 0
for time in times:
    if time % 10 == 0:
        total_time += time
    else:
        total_time += time + (10 - time % 10)
total_time += last

print(total_time)

Submission status: Runtime Error

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

zako=9
switch=0
for i in range(5):
    b=a[i]%10
    if b<=zako and b!=0:
        zako=b
        memory=i
        switch=1

if switch=0:
    memory=1
x=a.pop(memory)

lst=[]

for i in range(4):
    c=a[i]//10
    c=c*10
    if a[i]%10!=0:
        c+=10
    lst.append(c)

print(x+sum(lst))

Submission status: Runtime Error

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

zako=9
for i in range(5):
    b=a[i]%10
    if b<=zako and b!=0:
        zako=b
        memory=i
x=a.pop(memory)

lst=[]

for i in range(4):
    c=a[i]//10
    c=c*10
    if a[i]%10!=0:
        c+=10
    lst.append(c)

print(x+sum(lst))

Submission status: Runtime Error

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

zako=9
for i in range(5):
    b=a[i]%10
    if b<zako and b!=0:
        zako=b
        memory=i
x=a.pop(memory)

lst=[]

for i in range(4):
    c=a[i]//10
    c=c*10
    if a[i]%10!=0:
        c+=10
    lst.append(c)

print(x+sum(lst))

Submission status: Runtime Error

Solution code:
import math
A=0
B=[]
C=list(int(input()) for _ in range(5))
for i in C:
  if i%10==0:A+=i
  else:B.append(i)
for j in B[:-1]:A+=math.ceil(j/10)*10
A+=B[-1]
print(A)

Submission status: Runtime Error

Solution code:
import math
A=0
B=[]
C=list(map(int,input()) for _ in range(5))
for i in C:
  if i%10==0:A+=i
  else:B.append(i)
for j in B[:-1]:A+=math.ceil(j/10)*10
A+=B[-1]
print(A)

Submission status: Runtime Error

Solution code:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a = [str(input()) for _ in range(5)]

n = 9

for i in range(len(a)):
	if int(a[i][-1]) <= n and int(a[i][-1]) != 0 :
		n = int(a[i][-1])
		cnt = i

for i in range(len(a)):
	if i == cnt:
		a[i] = int(a[i])
	elif int(a[i][-1]) == 0:
		a[i] = int(a[i])
	else:
		a[i] = (int(a[i])//10 + 1)*10
print(a)
print(sum(a))

Submission status: Runtime Error

Solution code:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a = [str(input()) for _ in range(5)]

n = 9

for i in range(len(a)):
	if int(a[i][-1]) < n and int(a[i][-1]) != 0 :
		n = int(a[i][-1])
		cnt = i

for i in range(len(a)):
	if i == cnt:
		a[i] = int(a[i])
	elif int(a[i][-1]) == 0:
		a[i] = int(a[i])
	else:
		a[i] = (int(a[i])//10 + 1)*10
print(sum(a))

Submission status: Runtime Error

Solution code:
def main():
    x = [int(input()) for _ in range(5)]
    d = min(((i % 10, i) for i in x if i % 10 != 0), key=lambda x: x[0])
    i = x.index(d[1])
    t = 0
    for idx, v in enumerate(x):
        if idx == i or v % 10 == 0:
            t += v
        else:
            t += v + 10 - (v % 10)
        #print(idx, t)
    print(t)
    
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())
answer = 0
cooking_time_order = sorted([A, B, C, D, E], key=lambda x: 10 - (x % 10))
for _ in range(5):
    if cooking_time_order[-1] % 10 == 0:
        answer += cooking_time_order[-1]
        cooking_time_order.pop()
    else:
        break
for cooking_time in cooking_time_order[:-1]:
    answer += (cooking_time + (10 - (cooking_time % 10)))
answer += (cooking_time_order[-1])
print(answer)