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: Wrong Answer

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

cnt = 0
L = [a,b,c,d,e]
L1 =set(L)
l =[]
if len(L1) == 1:
    cnt += 4 * (10 - L[0] % 10) + sum(L)
    print(cnt)
    exit()

for i in L:
    if len(str(i)) == 1:
        cnt += 10-i
    elif i%10 == 0:
        cnt += 0
    elif i%10 > 5:
        cnt += 10- i%10
    elif i%10 <= 5:
        l.append(i)

if len(l) == 0 or len(l) == 1:
    print(sum(L) + cnt)
elif len(l) >= 2:
    l1 = [i%10 for i in l]
    print(sum(L) + cnt + (sum(l1) - max(l1)))
    exit()

Submission status: Wrong Answer

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(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: Wrong Answer

Solution code:
times = [int(input()) for _ in range(5)]
diff = [False for i in range(10)]
for time in times:
    diff[time%10]=True
res = 0
for i in range(1, 10):
    if diff[i]:
        res=i
        break

for i in range(5):
    rep = times[i]//10
    if times[i]%10!=0:
        rep+=1
    times[i] = rep*10

print(sum(times) - (10 - res))

Submission status: Wrong Answer

Solution code:
menu = [int(input()) for i in range(5)]
menu1=[]
menu2 = []
sum = 0
for i in range(5):
    if menu[i]%10 > 5:
        menu1.append(menu[i] + (10-(menu[i]%10)))
    elif menu[i]%10 == 0:
        menu1.append(menu[i])
    else:
        menu2.append(menu[i])

menu2.sort()

if len(menu2) > 1:
    for i in range(len(menu2)-1):
        menu2[i] += 10-(menu[i]%10)

menu1.extend(menu2)

for i in menu1:
    sum += i

print(sum)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
# Input
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

list= [a, b, c, d, e]

i = 1
for ii in range(len(list) - 1):
    if list[i] % 10 == 0:
        k = list[i - 1]
        list[i - 1] = list[i]
        list[i] = k
    i += 1

count = 0
for ii in range(len(list)-1):
    if list[ii] % 10 == 0:
        count += list[ii]
    else:
        count += int(math.ceil(list[ii]/10) * 10)

count += list[len(list) - 1]
print(count)

Submission status: Wrong Answer

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

a1=[]
b1=[]
c1=[]
d1=[]
e1=[]
sum = a + b + c + d + e

while a>0:
    a1.append(a % 10)
    a //= 10

while b>0:
    b1.append(b % 10)
    b //= 10

while c>0:
    c1.append(c % 10)
    c //= 10

while d>0:
    d1.append(d % 10)
    d //= 10

while e>0:
    e1.append(e % 10)
    e //= 10

min = min(a1[0], b1[0], c1[0], d1[0], e1[0])
sum += (40 - a1[0] - b1[0] - c1[0] - d1[0] - e1[0] + min)

print(sum)

Submission status: Wrong Answer

Solution code:
A=[]
ans=0
for i in range(5):
  A.append(int(input()))
s=0
for i in A:
  if i%10==0:
    ans+=i
    del A[s]
  s+=1
    
y=0
Max=0
for i in A:
  X=10-(i%10)
  if Max<=X:
    A[0],A[y]=A[y],A[0]
    Max=X
  y+=1

ans+=A[0]
A=A[1:]
for i in A:
  i+=10-(i%10)
  ans+=i
print(ans)

Submission status: Wrong Answer

Solution code:
# coding=utf-8

# write code...
import math

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
List1=[a,b,c,d,e]
List2=[(a-1)%10,(b-1)%10,(c-1)%10,(d-1)%10,(e-1)%10]

# List.index()で()内の値を探す。↓の場合最小値を含むリストのインデックスを探索
index=List2.index(min(List2))

# math.ceil切り上げ。全部切り上げて、一番待ち時間が長いものだけを引いて
ans = math.ceil(a/10)+math.ceil(b/10)+math.ceil(c/10)+math.ceil(d/10)+math.ceil(e/10)-math.ceil(List1[index]/10)+List1[index]/10
ans = int(ans*10)

print(math.ceil(a),index, ans)

Submission status: Wrong Answer

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

sorted_list = sorted(input_list, key=lambda v: v%10, reverse=True)

time = 0
for v in sorted_list[:-1]:
    time += math.ceil(v/10)*10
time += sorted_list[-1]

# print(sorted_list)
print(time)

Submission status: Wrong Answer

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

cnt = 0
L = [a,b,c,d,e]
L1 =set(L)
l =[]
if len(L1) == 1:
    cnt += 4 * (10 - L[0] % 10) + sum(L)
    print(cnt)
    exit()

for i in L:
    if len(str(i)) == 1:
        cnt += 10-i
    elif i%10 == 0:
        cnt += 0
    elif i%10 > 5:
        cnt += 10- i%10
    elif i%10 <= 5:
        l.append(i)

if len(l) == 1:
    pass
if len(l) >= 2:
    l1 = [i%10 for i in l]
    m = 10 - max(l1)
    print(sum(L) + cnt + (sum(l1) - max(l1)))
    exit()

print(sum(L) + cnt)

Submission status: Wrong Answer

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):
    try:
        min_except0.remove(0)
    except:
        pass
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]
  print(answer)
answer += g[x]

minas = 10*(5 - len(min_except0))

answer -= minas

print(answer)

Submission status: Wrong Answer

Solution code:
a = [int(input()) for _ in range(5)]
b = sorted(a, key = lambda x: x%10)
c = [(i, b[i]) for i in range(5)]
num = [1,2,3,4,5,6,7,8,9,0]
x = 0
ans = 0
for i, value in c:
    if value%10 == 0:
        ans += value
    else:
        x = i
        break
for i in range(x+1, 5):
    ans += (c[i][1] + (10 - c[i][1]%10))
print(ans + c[x][1])

Submission status: Wrong Answer

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]

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

Submission status: Wrong Answer

Solution code:
a=int(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: Wrong Answer

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]

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

Submission status: Wrong Answer

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

a = 10
y = 0
for i in range(5):
  s = int(l[i]) % 10
  if a > s & s != 0:
    a = s
    y = i

sum = 0
for i in range(5):
  if y == i:
    sum += int(l[y])
  else:
    sum += int(l[i])
    sum += (10 - (int(l[i])%10))
print(sum)

Submission status: Wrong Answer

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

ans = []
if a % 10 != 0:
    a = 10 - (a % 10)
    ans = a
else:
    ans = a

# print(ans)

if b % 10 != 0:
    b = ans + 10 - (b % 10)
    ans = a + b
else:
    ans = a + b

# print(ans)

if c % 10 != 0:
    c =  ans + 10 - (c % 10)
    ans = ans + c
else:
    ans = ans + c

if d % 10 != 0:
    d = ans + 10 - (d % 10)
    ans = ans + d
else:
    ans = ans + d


ans = ans + e

print(ans)

Submission status: Wrong Answer

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]

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

Submission status: Wrong Answer

Solution code:
#１のくらいのみ見れはいい？
import numpy as np
a=29
b=20
c=7
d=35
e=120
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=10-ls_1
ls_1_10[ls_1_10==10]=0
#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: Wrong Answer

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

def ceil(src, range):
    return ((int)(src / range) + 1 ) * range
x1 = [x[i] % 10 for i in range(5)]
x2 = [ceil(x[i], 10) for i in range(5)]
skip = x1.index(min(x1))
last = x[skip]
x2[skip] = 0
result = sum(x2) + last
print(result)

Submission status: Wrong Answer

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

l = [a, b, c, d, e]
order_l = []

for i in l:
    j = round(i, -1)
    i = j - i
    order_l.append(i)

max_order = max(order_l)
k = order_l.index(max_order)
l.append(l[k])
l.pop(k)

order_l.append(order_l[k])
order_l.pop(k)

ans = sum(l) + sum(order_l) - order_l[4]
print(ans)

Submission status: Wrong Answer

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

amarino_times = [i % 10 for i in times]
#
# min_index = amarino_times.index(min(amarino_times))
#
# last_choose_time = times.pop(min_index)
#
#
# sum = 0
# for i in times:
#     sum += i
#     if i % 10 != 0:
#         sum += 10 - (i % 10)
#
# sum += last_choose_time
#
# hoge = 0
# for i in amarino_times:
#     if i == 0:
#         hoge += 1
# for i in range(hoge):
#     fuga = amarino_times.pop(amarino_times.index(min(amarino_times)))
# print(hoge)
# if hoge:
#     sum -= min(amarino_times)
#
#
# print(sum)

sum = 0
for i in times:
    if i % 10 == 0:
        sum += i
    else:
        sum += i + 10-i % 10

hoge = []
for i in range(len(amarino_times)):
    if amarino_times[i] != 0:
        hoge.append(amarino_times[i])

hoge.append(9)
if all(amarino_times):
    sum -= (10-min(hoge))

print(sum)

Submission status: Wrong Answer

Solution code:
A = input()
B = input()
C = input()
D = input()
E = input()
L = [A,B,C,D,E]
#L_s = str(L)
m=9
for i in L:
    if(i[-1]!="0"):
        m=min(m,int(i[-1]))

ans=0
for i in L:
    if(i[-1]==str(m)):
        ans+=int(i)
        #print(i)
    else:
        ans+=int(i)
        if(i[-1]!="0"):
            ans+=10-int(i[-1])
print(ans)

Submission status: Wrong Answer

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

b = []
c = []
for j in range(5):
    if a[j] % 10 == 0:
        b.append(a[j]-10)
        c.append(100)
    else:
        #10で割った余りを引く
        num = a[j]%10
        c.append(num)
        b.append(a[j] - c[j])

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

print(b_sum + c_sum)

Submission status: Wrong Answer

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

ans = []
if a % 10 != 0:
    a = 10 - (a % 10)
    ans = a
else:
    ans = a

# print(ans)

if b % 10 != 0:
    b = a + 10 - (b % 10)
    ans = a + b
else:
    ans = a + b

# print(ans)

if c % 10 != 0:
    c = a + b + 10 - (c % 10)
    ans = a + b + c
else:
    ans = a + b + c

if d % 10 != 0:
    d = a + b + c + 10 - (d % 10)
    ans = a + b + c + d
else:
    ans = a + b + c + d


ans = a + b + c + d + e

print(ans)

Submission status: Wrong Answer

Solution code:
a=int(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)):
    if (min_list[i]%10)==0:
        minute += min_list[i]
    else:
        minute = 10-(min_list[i]%10)+min_list[i]

print(minute)

Submission status: Wrong Answer

Solution code:
import numpy as np
order = [int(input()) for _ in range(5)]
first = []
rest = [0 for _ in range(5)]
for i in range(5):
    first.append(str(order[i])[-1:])
    first[i] = int(first[i])
    rest[i] = 10 - int(first[i])

first_arr = np.array(first)
first_arr = list(first_arr.argsort()[::-1])
rest_arr = np.array(rest)
rest_arr = list(rest_arr.argsort()[::-1])

time = 0
for i in range(4):
    time += order[first_arr[i]] + rest_arr[i]
    #print(order[first_arr[i]], time)

final_time = time + (10 - time%10)+ order[first_arr[4]]
print(final_time)

Submission status: Wrong Answer

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=10-ls_1
ls_1_10[ls_1==10]=0
#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: Wrong Answer

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

ans = []
if a % 10 != 0:
    a += 10 - (a % 10)
    ans = a
else:
    ans = a

# print(ans)

if b % 10 != 0:
    b += a + 10 - (b % 10)
    ans = a + b
else:
    ans = a + b

# print(ans)

if c % 10 != 0:
    c += a + b + 10 - (c % 10)
    ans = a + b + c
else:
    ans = a + b + c

if d % 10 != 0:
    d += a + b + c + 10 - (d % 10)
    ans = a + b + c + d
else:
    ans = a + b + c + d

if e % 10 != 0:
    e += a + b + c + d + 10 - (e % 10)
    ans = a + b + c + d + e
else:
    ans = a + b + c + d + e

print(ans)

Submission status: Wrong Answer

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

amarino_times = [i % 10 for i in times]
#
# min_index = amarino_times.index(min(amarino_times))
#
# last_choose_time = times.pop(min_index)
#
#
# sum = 0
# for i in times:
#     sum += i
#     if i % 10 != 0:
#         sum += 10 - (i % 10)
#
# sum += last_choose_time
#
# hoge = 0
# for i in amarino_times:
#     if i == 0:
#         hoge += 1
# for i in range(hoge):
#     fuga = amarino_times.pop(amarino_times.index(min(amarino_times)))
# print(hoge)
# if hoge:
#     sum -= min(amarino_times)
#
#
# print(sum)

sum = 0
for i in times:
    if i % 10 == 0:
        sum += i
    else:
        sum += i + 10-i % 10

hoge = []
for i in range(len(amarino_times)):
    if amarino_times[i] != 0:
        hoge.append(amarino_times[i])

hoge.append(9)
sum -= (10-min(hoge))

print(sum)

Submission status: Wrong Answer

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

ans = []
if a % 10 != 0:
    a += 10 - (a % 10)
    ans = a
else:
    ans = a

# print(ans)

if b % 10 != 0:
    b += a + 10 - (b % 10)
    ans = a + b
else:
    ans = a + b

# print(ans)

if c % 10 != 0:
    c += a + b + 10 - (c % 10)
    ans = a + b + c
else:
    ans = a + b + c

if d % 10 != 0:
    d += a + b + c + 10 - (d % 10)
    ans = a + b + c + d
else:
    ans = a + b + c + d


ans = a + b + c + d + e

print(ans)

Submission status: Wrong Answer

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

if any(dish_d) == 0:
    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
    print(0)
else:
    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: Wrong Answer

Solution code:
x = [input() for _ in range(5)]
t = 9
fl = False
digits = 0
for idx, i in enumerate(x):
	digits = len(i)
	a = int(i[-1])
	if a != 0:
		if t > a:
			t = a
			fl = True
		if digits == 1:
			x[idx] = "10"
		elif digits == 2:
			i = str(int(i) + 10)
			x[idx] = "".join((i[-2], "0"))
		else:
			i = str(int(i) + 10)
			x[idx] = "".join((i[-3], i[-2], "0"))
if not fl: t = 10
print(sum([int(_) for _ in x]) - 10 + t)

Submission status: Wrong Answer

Solution code:
import itertools
List=[int(input()) for i in range(5)]
List_2=list(itertools.permutations(List))
min = 100000
for i in List_2:
  time = 0
  for j in i:
    if j != i[len(i)-1]:
      time += j
      if time % 10 != 0:
        time = ((time // 10) + 1) * 10  
    elif j == i[len(i) -1] :
      time += j
  if time < min:
    min = time
print(min)

Submission status: Wrong Answer

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

a = 10 - (A % 10)
b = 10 - (B % 10)
c = 10 - (C % 10)
d = 10 - (D % 10)
e = 10 - (E % 10)
f = max(a, b, c, d, e)
print(A + B + C + D + E + a + b + c + d + e - f)

Submission status: Wrong Answer

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

items = [a, b, c, d, e]
import itertools
import math
min_total = 1000
p = itertools.permutations(items, len(items))
for v in itertools.permutations(items, len(items)):
    total = 0
    print(v)
    for i, item in enumerate(v):
        if i != len(v) - 1:
            total += math.ceil(item / 10) * 10
        else:
            total += item
    min_total = min(min_total, total)
print(min_total)

Submission status: Wrong Answer

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

menu = [a, b, c, d, e]

time = 0
count = 0
for i in range(5):
    if menu[i] % 10 == 0:
        tmp = menu[count]
        menu[count] = menu[i]
        menu[i] = tmp
        count += 1
           

while True:
    flg = 0
    for i in range(4-count):
        num1 = menu[i+count]
        num2 = menu[i+count+1]
        if num1 % 10 < num2 % 10:
            menu[i+count] = num2
            menu[i+count+1] = num1
            flg = flg + 1
    if flg == 0:
        break


for i in range(4):
    time += (menu[i]+ (10-menu[i]%10))
time += menu[4]
print(time)

Submission status: Wrong Answer

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(len(amari_list)):
    if (amari_list[i]%10)==0:
        minute += amari_list[i]
    else:
        minute = 10-(amari_list[i]%10)+amari_list[i]

print(minute)

Submission status: Wrong Answer

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

if all(dish_d) == 0:
    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
    
else:
    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: Wrong Answer

Solution code:
import numpy as np
order = [int(input()) for _ in range(5)]
first = []
rest = [0 for _ in range(5)]
for i in range(5):
    first.append(str(order[i])[-1:])
    first[i] = int(first[i])
    rest[i] = 10 - int(first[i])

first_arr = np.array(first)
first_arr = list(first_arr.argsort()[::-1])
rest_arr = np.array(rest)
rest_arr = list(rest_arr.argsort()[::-1])

time = 0
for i in range(4):
    time += order[first_arr[i]] + rest_arr[i]
    print(order[first_arr[i]], time)

final_time = time + (10 - time%10)+ order[first_arr[4]]
print(final_time)

Submission status: Wrong Answer

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

t = sorted(t, key=lambda e: 0 if e%10 == 0 else 10 - e%10)

print(sum(e - e%10 + 10 for e in t[:-1]) + t[-1])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
X = [0]*5
Y = [0]*5
diff = [0]*5

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

Y = [(x // 10)*10 if x % 10 == 0 else (x // 10 + 1)*10 for x in X]
dif = [Y[i]-X[i] for i in range(5)]

i = 0
sum = 0
count = 0

for i in range(5):
    if (dif[i] != max(dif)):
        sum = sum + Y[i]
    else:
        s = Y[i]
        t = X[i]
        count = count + 1

sum = sum + (count-1)*s + t

print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
in_list = []
out = 0
modLast = 10
p1 = -1
for i in range(5):
  in_list.append(int(input()))
in_list.sort();
for i in in_list:
  if i % 10 != 0:
    out += i + 10 - i % 10
  else:
    out += i
  if p1 == i // 10 or i % 10 < modLast:
    modLast = i % 10
print(out - 10 + modLast)

Submission status: Wrong Answer

Solution code:
a = [int(input())  for i in range(5)]
def amari(num):
    return num % 10
b = list(map(amari, a))
d = min(b)
c = sum(a) - sum(b) + 40 + d
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = [input() for _ in range(5)]
t = 9
digits = 0
for idx, i in enumerate(x):
	digits = len(i)
	a = int(i[-1])
	if a != 0:
		if t > a:
			t = a
		if digits == 1:
			x[idx] = "10"
		elif digits == 2:
			i = str(int(i) + 10)
			x[idx] = "".join((i[-2], "0"))
		else:
			i = str(int(i) + 10)
			x[idx] = "".join((i[-3], i[-2], "0"))
print(sum([int(_) for _ in x]) - 10 + t)

Submission status: Wrong Answer

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

cnt = 0
L = [a,b,c,d,e]
L1 =set(L)
l =[]
if len(L1) == 1:
    cnt += 4 * (10 - L[0] % 10) + sum(L)
    print(cnt)
    exit()
for i in L:
    if len(str(i)) == 1:
        cnt += 10-i
    elif i%10 == 0:
        cnt += 0
    elif i%10 > 5:
        cnt += 10- i%10
    elif i%10 <= 5:
        l.append(i)
print(sum(L) + cnt)

Submission status: Wrong Answer

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

t = sorted(t, key=lambda e: 0 if e%10 == 0 else 10 - e%10)

print(sum(e - e%10 + 10 for e in t))

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
L = [int(input()) for i in range(5)]
l = [n % 10 if not (n % 10 == 0) else 100 for n in L]
i = l.index(min(l))
I = 10 - (L[i] % 10) + L[i]
SUM = sum([n + 10 - (n % 10) if not (n % 10 == 0) else n for n in L])
# print(i, I, SUM)
ans = SUM - I + L[i]
print(ans)

Submission status: Wrong Answer

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

def f(e):
  return 0 if e%10 == 0 else 10 - e%10
  
t = sorted(t, key=f)

print(sum(e - e%10 + 10 for e in t))

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
import sys

data = list(int(input()) for _ in range(5))

ans = 0

for zero_c in range(len(data)):
  if divmod(data[zero_c], 10)[1] == 0:
    ans += data[zero_c]
    data[zero_c] = 0

for i in range(9, 0, -1):
  for j in range(len(data)):
    if data.count(0) == 4:
      ans += max(data)
      print(ans)
      sys.exit()
    else:
      if divmod(data[j], 10)[1] == i:
        ans += data[j] + (10 - i)
        data[j] = 0

Submission status: Wrong Answer

Solution code:
array = [int(input()) for i in range(5)]
array2 = [] # 繰り上げの値
array3 = []#一の位

for i in array:
  array2.append((i//10 + 1 ) if i%10 != 0 else i//10 * 10)
  array3.append(i%10 if i%10 != 0 else 10)

print(sum(array2)-(10-min(array3)))

Submission status: Wrong Answer

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]

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: Wrong Answer

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

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

list2 = [a%10,b%10,c%10,d%10,e%10]   
for i in range(5):
    if list2[i] == 0:
        list2[i] += 10


for i in range(5):
    for j in range(i,5):
        if list2[i]<list2[j]:
            temp = list[i]
            list[i] = list[j]
            list[j] = temp
            

s = 0
for i in range(4):
    if int(list[i])%10 != 0:
        s += int(list[i])-int(list[i])%10+10
    else:
        s += int(list[i])

s += int(list[4])

print(s)

Submission status: Wrong Answer

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

A1= A//10
A2= A%10
B1= B//10
B2= B%10
C1= C//10
C2= C%10
D1= D//10
D2= D%10
E1= E//10
E2= E%10

if A2*B2*C2*D2*E2 != 0:
  S1=(A1+B1+C1+D1)*10+40+E
  S2=(B1+C1+D1+E1)*10+40+A
  S3=(C1+D1+E1+A1)*10+40+B
  S4=(D1+E1+A1+B1)*10+40+C
  S5=(E1+A1+B1+C1)*10+40+D
  print min([S1,S2,S3,S4,S5])

else:
  if A %10 == 0:
    S6 = A
  else:
    S6 = (A//10)*10+10
  if B %10 == 0:
    S6 = S6 + B
  else:
    S6 = S6 + (B//10)*10+10
  if C %10 == 0:
    S6 = S6 + C
  else:
    S6 = S6 + (C//10)*10+10
  if D %10 == 0:
    S6 = S6 + D
  else:
    S6 = S6 + (D//10)*10+10
  if E %10 == 0:
    S6 = S6 + E
  else:
    S6 = S6 + (E//10)*10+10
  print S6

Submission status: Wrong Answer

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 == 0:
    e = 10


key = {a:A,b:B,c:C,d:D,e:E}
list_ = [a,b,c,d,e]
list_.sort(reverse = True)


i = 0
sum = 0
while i < 4:
    sum += key[list_[i]]
    while not sum % 10 == 0:
        sum += 1
    i += 1

sum += key[list_[4]]
print(sum)