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:
import sys
def Main():
  A = int(input())
  B = int(input())
  C = int(input())
  D = int(input())
  E = int(input())
    

  Last = A
    
  if Last%10 > B%10:
    Last = B
    
  if Last%10 > C%10:
  	Last = C
      
  if Last%10 > D%10:
   	Last = D
      
  if Last%10 > E%10:
    Last = E
    
  BeforeTotal = (A/10+1)*10+(B/10+1)*10+(C/10+1)*10+(D/10+1)*10+(E/10+1)*10
  AfterTotal = BeforeTotal - (Last/10+1)*10 +Last
    
  print(AfterTotal)
    
Main()

Submission status: Wrong Answer

Solution code:
from numpy import array, argmax, ones

InRange = 5

# 入力受け取り
a_e = array([int(input()) for i in range(InRange)])

# 1桁目が0以外で最小
a_e10 = 10 - a_e % 10
a_e10[a_e10 == 10] = 0

sum_index = ones(InRange, dtype=bool)
sum_index[argmax(a_e10)] = False

sum_time = a_e.sum() + a_e10[sum_index].sum()

Submission status: Wrong Answer

Solution code:
a=[int(input()) for _ in range(5)]
a.sort(reverse=True)
a=[i*10 + j for i, j in enumerate(a)]
print(max(a))

Submission status: Wrong Answer

Solution code:
a=[int(input()) for _ in range(5)]
a.sort()
a=[i*10 + j for i, j in enumerate(a)]
print(max(a))

Submission status: Wrong Answer

Solution code:
inputs = [int(input()) for i in range(5)]
summ = 0
k = 10
for i in inputs:
    if i % 10 == 0:
        summ = summ + i
    else:
        s, m = divmod(i, 10)
        summ = summ + (s + 1) * 10
        if m < k:
            k = m

summ = summ +((10-k)%10)
print(summ)

Submission status: Wrong Answer

Solution code:
inputs=[int(input()) for i in range(5)]
summ=0
k=0
for i in inputs:
    if i%10==0:
        summ=summ+i
    else:
        s,m=divmod(i,10)
        summ=summ+(s+1)*10
        if 10-m>10-k:
          k=m
summ=summ-10+k
print(summ)

Submission status: Wrong Answer

Solution code:
import sys

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

time = 0
count = 0

for i,item in enumerate(lines):
	if item%10 == 0:
		time += item
		lines[i] = 0
		count += 1
		print(item)

for i in reversed(range(9)):
	print("#",i)
	for j,item in enumerate(lines):
		if item%10 == i+1:
			time += item
			lines[j] = 0
			count += 1
			if count != 5:
				time += (10 - (i+1))
			print(item,time)

print(time)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math


def main():
    li = sorted([int(input()) for _ in range(5)],
                key=lambda i: i % 10)
    s = 0
    idx = -1
    for i, el in enumerate(li):
        if idx == -1 and el % 10 > 0:
            idx = i
            continue
        s += math.ceil(el/10) * 10
    s += li[idx]
    print(s)


main()

Submission status: Wrong Answer

Solution code:

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


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

def nokori(az, sitei):
	tmp = []
	for a in az:
		if a != sitei:
			tmp.append(a)
	return tmp

def calcOrder(order):
	time = 0
	for o in order:
		if time % 10 != 0:
			time += 10 - time % 10
		time += o
	return time

time = 0
mintime = 1000
res = ''

for fst in orders:
	
	az = nokori(orders, fst)
	for sec in az:
		ax = nokori(az, sec)
		for thd in ax:
			aw = nokori(ax, thd)
			for fth in aw:
				af = nokori(aw, fth)
				for fif in af:
					time = calcOrder([fst,sec,thd,fth,fif])
					if time < mintime:
						mintime = time
						res = str([fst,sec,thd,fth,fif])

print(mintime)

Submission status: Wrong Answer

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

total = a+b+c+d+e
print(total)

Submission status: Wrong Answer

Solution code:
import itertools
dishes=[int(input()) for i in range(5)]
all_comb=list(itertools.permutations(dishes))
t_min=123*5
for comb in all_comb:
  t=0
  for i in range(4):
    t=int((t+comb[i]-1)/10)*10+10
  t=t+comb[4]
  if t < t_min:
    t_min=t
print(t_min)

Submission status: Wrong Answer

Solution code:
l = [int(input()) for _ in range(5)]
r = [10 if i % 10 == 0 else i %  10 for i in l]
m = [i  if i % 10 == 0 else i // 10 * 10 + 10 for i in l]
print(sum(l) + min(r) - 10)

Submission status: Wrong Answer

Solution code:
from functools import reduce
l = [int(input()) for _ in range(5)]
r = [10 if i % 10 == 0 else i %  10 for i in l]
m = [i  if i % 10 == 0 else i // 10 * 10 + 10 for i in l]
print(sum(l) + min(r) - 10)

Submission status: Wrong Answer

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

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

min_cost = 100
ans = 0
for cost in cost_list:
    wait_cost = cost % 10

    if wait_cost < min_cost and wait_cost != 0:
        min_cost = wait_cost

    wait_next_order = 0
    if wait_cost != 0:
        wait_next_order = 10 - wait_cost

    ans += cost + wait_next_order

max_wait_cost = 0
if min_cost != 0:
    max_wait_cost = 10 - min_cost
print(ans - max_wait_cost)

Submission status: Wrong Answer

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

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

min_cost = 100
ans = 0
for cost in cost_list:
    wait_cost = cost % 10

    if wait_cost < min_cost and wait_cost != 0:
        min_cost = wait_cost

    wait_next_order = 0
    if wait_cost != 0:
        wait_next_order = 10 - wait_cost

    ans += cost + wait_next_order

max_wait_cost = 10 - min_cost
print(ans - max_wait_cost)

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]
l_times_ten = []
amari_list = []
time = 0
for i in range(len(l)):
    amari = l[i] % 10
    amari_list.append(amari)
    if amari == 0:
        l_times_ten.append(l[i])
    elif amari != 0:
        l_tmp =  l[i] +(10 - amari)
        l_times_ten.append(l_tmp)
max_total_time = sum(l_times_ten)
min_total_time = max_total_time - (10 - max(amari_list))
print(min_total_time)

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]
l_times_ten = []
amari_list = []
time = 0
for i in range(len(l)):
    amari = l[i] % 10
    amari_list.append(amari)
    if amari == 0:
        l_times_ten.append(l[i])
    elif amari != 0:
        l_tmp =  l[i] +(10 - amari)
        l_times_ten.append(l_tmp)
# print(l_times_ten)
# print(amari_list)
max_total_time = sum(l_times_ten)
min_total_time = max_total_time - (10 - max(amari_list))
print(min_total_time)

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]
l_times_ten = []
amari_list = []
time = 0
for i in range(len(l)):
    amari = l[i] % 10
    amari_list.append(amari)
    if amari == 0:
        l_times_ten.append(l[i])
    elif amari != 0:
        l_tmp =  l[i] +(10 - amari)
        l_times_ten.append(l_tmp)

max_total_time = sum(l_times_ten)
min_total_time = max_total_time - max(amari_list)
print(min_total_time)

Submission status: Wrong Answer

Solution code:
lst = []
for i in range(5):
    lst.append(int(input()))
    if i < 0 or i > 123:
        print("wrong input")
        sys.exit()

t = 0
for x in lst:
    if x % 10 == 0:
        t += x
        lst.remove(x)

lss = sorted(lst, reverse = True, key = lambda x:x%10)

while len(lss) > 1:
    t += lss.pop(0)
    t += 10 - t % 10

t += lss[0]
print(t)

Submission status: Wrong Answer

Solution code:

list = [int(input()) for i in range(5)]
kList = []
for j in range(0,10):
    for i in list:
         if (i+j) % 10 == 0:
            if i % 10 != 0:
                kList.append(i+j) 
            else:
                kList.append(i)

nList = [i for i in kList[0:len(kList)-1]]
print(sum(nList) + kList[-1])

Submission status: Wrong Answer

Solution code:
from functools import reduce
from math      import ceil
l = [int(input()) for _ in range(5)]
r = [i % 10 for i in l if i % 10 != 0]
m = [ceil(i / 10) * 10 + 10 for i in l]
print(reduce(lambda a, b: a + b, m) + (min(r) - 10 if r else 0))

Submission status: Wrong Answer

Solution code:
A = [int(input()) for i in range(5)]
B = [round(a, -1) + 10 if (0 < int(str(a)[-1]) < 5) else round(a, -1) for a in A]
diff = [(b - a) for a, b in zip(A, B)]

print(sum(B)-max(diff))

Submission status: Wrong Answer

Solution code:
B = [int(input()) for _ in range(5)]
A = [str(B[i])[-1] for i in range(5)]
temp = A
if "0" in temp == True:
  temp.remove("0")
last = A.index(min(temp))
diff = [10-int(A[o]) for o in range(5) if (A[o] != "0") and o != last]
print(sum(B)+sum(diff))

Submission status: Wrong Answer

Solution code:
inputs=[int(input()) for i in range(5)]
summ=0
for i in inputs:
    if i%10==0:
        summ=summ+i
    else:
        s=i//10
        summ=summ+(s+1)*10
print(summ)

Submission status: Wrong Answer

Solution code:
N = sorted([(input())for i in range(5)],key=lambda x:x[-1])
S = list(map(int,N))
print(S)
#合計時間
num = 0
key = 0
for x in S:
  if x % 10 == 0:
    num += x
  elif key == 0 and x % 10 != 0:
    num += x 
    key = 1
  else:
    num += x + 10 - int(str(x)[-1])
print(num)

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
 
print(A+B+C+D+E+a+b+c+d+e-max([a,b,c,d,e]))

Submission status: Wrong Answer

Solution code:
from functools import reduce
l = [int(input()) for _ in range(5)]
r = [i % 10 for i in l if i % 10 != 0]
l = [i if i % 10 == 0 else i // 10 * 10 + 10 for i in l]
print(reduce(lambda a, b: a + b, l) + min(r) - 10 if r else 0)

Submission status: Wrong Answer

Solution code:
from functools import reduce
l = [int(input()) for _ in range(5)]
r = [i % 10 for i in l if i % 10 != 0]
l = [i if i % 10 == 0 else i // 10 * 10 + 10 for i in l]
print(reduce(lambda a, b: a + b, l) + min(r if r else [0]) - 10)

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 == 9:
        b.append(a[j]-9)
        c.append(10)
    elif a[j] % 10 == 0:
        b.append(a[j]-10)
        c.append(10)
    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:
# B
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
 
print(A+B+C+D+E+a+b+c+d+e-max([a,b,c,d,e]))

Submission status: Wrong Answer

Solution code:
import itertools

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

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

dec = [n % 10 for n in input]
pair = zip(dec, input)
min_val = 999
for num in dec:
  if num != 0 and min_val > num:
    min_val = num

sum = 0
min_flag = False
for d, n in pair:
  if not min_flag and (d == min_val or d == 0):
    min_flag = True
    sum += n
  else:
    sum += (n + (10 - d))
      
print(sum)

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(10)
    else:
        #10で割った余りを引く
        num = a[j] % 10
        c.append(num)
        b.append(a[j] - c[j])
 
b_sum = sum(b)
c_min = min(c)
if c_min ==10:
    c_sum = 4 * 10
else:
    c_sum = c_min + 4*10
 
print(b_sum + c_sum)

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:
        c.append(100)
        b.append(a[j]-10)
    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:
import numpy as np
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

S = []
sum = 0
if A != 0:
  S.append(A)
if B != 0:
  S.append(B)
if C != 0:
  S.append(C)
if D != 0:
  S.append(D)
if E != 0:
  S.append(E)
if len(S) == 0:
  sum = a + b + c + d + e
else:
  sum = (a //10 + b //10 + c //10 + d //10 + e //10)*10 + 40 +min(S)
print(sum)

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
 
print(A+B+C+D+E+a+b+c+d+e-max([a,b,c,d,e]))

Submission status: Wrong Answer

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

dis_a = 10 - a % 10 
dis_b = 10 - b % 10
dis_c = 10 - c % 10
dis_d = 10 - d % 10
dis_e = 10 - e % 10

time = {"a":a, "b":b, "c":c, "d":d, "e":e}
dic = {"a":dis_a, "b":dis_b, "c":dis_c, "d":dis_d, "e":dis_e}

for k,v in dic.items():
	if v == 10 :
		dic[k] = 0


new = {}
for k, v in sorted(dic.items(), key=lambda x: x[1]):
    new[k] = v

ans = 0
for i in range(4):
	ans += time[list(new.keys())[i]] + list(new.values())[i]

ans += time[list(new.keys())[4]]

print(ans)

Submission status: Wrong Answer

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

list = [a,b,c,d,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(4,i,-1):
        if list2[i]<list2[j]:
            temp = list[i]
            list[i] = list[j]
            list[j] = temp
            print(list)
            

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 = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

dis_a = 10 - a % 10
dis_b = 10 - b % 10
dis_c = 10 - c % 10
dis_d = 10 - d % 10
dis_e = 10 - e % 10

time = {"a":a, "b":b, "c":c, "d":d, "e":e}
dic = {"a":dis_a, "b":dis_b, "c":dis_c, "d":dis_d, "e":dis_e}

for k,v in dic.items():
	if v == 10 :
		dic[k] = 0


dic2 = sorted(dic.items())
print(dic2)

new = {}
for k, v in sorted(dic.items(), key=lambda x: x[1]):
    new[k] = v

ans = 0
for i in range(4):
	ans += time[list(new.keys())[i]] + list(new.values())[i]

ans += time[list(new.keys())[4]]

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:
        c.append(100)
        b.append(a[j]-10)
    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 = []
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 = []
for _ in range(5):
    b = int(input())
    t = 10 if b%10 == 0 else b%10
    a.append((t, b))
a.sort()
a.reverse()
c = 0
for i in range(4):
    c += (a[i][1] + (10 - a[i][1] % 10))
c += a[-1][1]
print(c)

Submission status: Wrong Answer

Solution code:
a = []
for _ in range(5):
    b = int(input())
    t = 10 if b%10 == 0 else b%10
    a.append((t, b))
a.sort()
a.reverse()
c = 0
for i in range(4):
    c += round(a[i][1], -1)
c += a[-1][1]
print(c)

Submission status: Wrong Answer

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

@author: yuta
"""

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

def main(x):
    rest = list(map(lambda y: 10 - y%10,x))
    print("before:",rest)
    for i in range(5):
        if rest[i] == 10:
            rest[i] = 0
    print("after:",rest)
    rest_sort = sorted(rest)
    t = sum(x) + sum(rest_sort[0:4])
    print(t)

main(ABCDE)

Submission status: Wrong Answer

Solution code:
times = list()
dish_num = 5
for i in range(dish_num):
    times.append(int(input()))

last = 0
for i in range(1, dish_num):
    if ((times[last]+9) % 10) > ((times[i]+9) % 10):
        last = i

for i in range(dish_num):
    if i != last:
        times[i] += (10 - times[i] % 10) % 10

result = 0
for t in times:
    result += t

print(times)
print(result)

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
print(menu)

for i in range(4):
    time += (menu[i])
    if menu[i] % 10 == 0:
        time += 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())

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


m = 10
cnt = 0
for i in memo:
    if i % 10 == 0:
        cnt += int(i/10)
    else:
        cnt += int(i/10)+1

    if i%10 < m:
        m = i%10

print(cnt*10-(10-m))

Submission status: Wrong Answer

Solution code:
A = [input() for i in range(5)]
A.sort(key = lambda x:x[-1])
A = [int(a) for a in A]
res = 0
for a in A:
	if a%10 == 0:
		res += a
	else:
		while a%10 != 0:
			a += 1
		res += a 
for a in A:
	if a%10 != 0:
		res -= a%10
		print(res)
		exit()
print(res)

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:
import numpy as np

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

order_time = [A,B,C,D,E]
elapsed_time = 0
extra = []
for i in order_time:
    ex = i%10
    extra.append(ex)
seiri = np.vstack((order_time,extra))
sort = np.sort(seiri)[:,::-1]
sort1 = sort[0]
sort2 =sort[1]
for i in range(len(sort1)-1):
    ort = sort2[i]
    otime = sort1[i]+(10-ort)
    elapsed_time += otime
elapsed_time+=sort1[-1]
print(elapsed_time)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
dish = [a,b,c,d,e]
dish = sorted(dish, key = lambda x: x % 10 , reverse = True)

temp = dish[0]
for i in range(1,5):
    temp = (temp // 10 + 1) * 10 + dish[i]
    
print(temp)

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

order_time = [A,B,C,D,E]
elapsed_time=0
extra = []
for i in order_time:
    ex = i%10
    extra.append(ex)
seiri = np.vstack((order_time,extra))
sort = np.sort(seiri)[:,::-1]
sort1 = sort[0]
sort2 =sort[1]
time = []
for i in range(0,len(sort2)-1):
    ort = sort2[i]
    otime = sort1[i]+(10-ort)
    elapsed_time += otime
    print(elapsed_time)
elapsed_time+=sort1[-1]
print(elapsed_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())

order_time = [A,B,C,D,E]
elapsed_time=0
extra = []
for i in order_time:
    ex = i%10
    extra.append(ex)
seiri = np.vstack((order_time,extra))
sort = np.sort(seiri)[:,::-1]
sort1 = sort[0]
sort2 =sort[1]
time = []
for i in range(0,len(sort2)-1):
    ort = sort2[i]
    otime = sort1[i]+(10-ort)
    elapsed_time += otime
elapsed_time+=sort1[-1]
print(elapsed_time)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
x = 0
lst = [a,b,c,d,e]
lst2 = []
for i in lst:
  if i%10 == 0:
    lst2.append(10)
  else:
    lst2.append(i%10)
print(lst2)
print(lst2.index(min(lst2)))
y = lst[lst2.index(min(lst2))]
del lst[lst2.index(min(lst2))]
for i in lst:
  if i%10 == 0:
    x += i
  else:
    x += (i//10+1)*10
x = x + y
print(x)

Submission status: Wrong Answer

Solution code:
list = [int(input()) for i in range(5)]
list_amari = [(i-1) % 10 +1 for i in list]
min = min(list_amari)
for i in range(5):
  min += list[i] - list_amari[i] +10
  
print(min)

Submission status: Wrong Answer

Solution code:
a=eval('int(input()),'*5);print(min(i%10for i in a)-9-sum(-i//10*10for i in a))

Submission status: Wrong Answer

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

Solution code:
li = []
for i in range(5):
  li.append(int(input()))
mi = 1e10
ans = 0
for i in range(5):
  ans+=(li[i]//10+1)*(10)
  mi = min(mi,li[i]%10)
print(ans - 10 + mi)

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

order_time = [A,B,C,D,E]
elapsed_time=0
extra = []
for i in order_time:
    ex = i%10
    extra.append(ex)
seiri = np.vstack((order_time,extra))
sort = np.sort(seiri)[:,::-1]
sort1 = sort[0]
sort2 =sort[1]
time = []
for i in range(0,len(sort2)-1):
    ort = sort2[i]
    otime=sort1[i]+(10-ort)
    elapsed_time+=otime
elapsed_time+=sort1[-1]
print(elapsed_time)

Submission status: Wrong Answer

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

def x(i):
    if i % 10 != 1:
        return i + (10 - i%10)
    return i

print(x(a) + x(b) + x(c) + x(d) + x(e) + min(a%10, b%10, c%10, d%10, e%10))

Submission status: Wrong Answer

Solution code:
li = []
for i in range(5):
  li.append(int(input()))
mi = 1e10
ans = 0
for i in range(5):
  ans+=(li[i]//10)*(11)
  mi = min(mi,li[i]%10)
print(ans - 10 + mi)

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

order_time = [A,B,C,D,E]
elapsed_time=0
extra = []
for i in order_time:
    ex = i%10
    extra.append(ex)
seiri = np.vstack((order_time,extra))
sort = np.sort(seiri)[:,::-1]
sort1 = sort[0]
sort2 =sort[1]
time = []
for i in range(0,len(sort)):
    ort = sort2[i]
    otime=sort1[i]+(10-ort)
    elapsed_time+=otime
elapsed_time+=sort1[-1]
print(elapsed_time)

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]
m = []
amari_list = []
time = 0
for i in range(len(l)):
    amari = l[i] % 10
    amari_list.append(amari)
    if amari == 0:
        m.append(l[i])
    elif amari != 0:
        l_tmp =  l[i] +(10 - amari)
        m.append(l_tmp)

max_total_time = sum(m)
min_time = max_total_time - max(amari_list)
print(min_time)

Submission status: Wrong Answer

Solution code:
print('Enter values!!')
abc = int(input())
arc = int(input())
agc = int(input())
apc = int(input())
atc = int(input())

food_time = [abc, arc, agc, apc, atc]
sort_time = [0, 0, 0, 0, 0]
total_time = 0


for i in range(5):
    sort_time[i] = food_time[i] % 10
    if food_time[i] % 10 == 0:
        total_time += food_time[i]
    else:
        a = food_time[i] // 10
        a = a * 10 + 10
        total_time += a

sort_time.sort()

for j in range(5):
    if sort_time[j] != 0:
        b = 10-sort_time[j]
        total_time -= b
        break

print(total_time)

Submission status: Wrong Answer

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

def x(i):
    if i % 10 != 1:
        return i + (10 - i%10)
    return i

print(x(a) + x(b) + x(c) + x(d) + x(e))

Submission status: Wrong Answer

Solution code:
import math
import numpy as np

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

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

list_1=[]
for i in range(len(list)):
    list_1.append(math.ceil(list[i]) * 10 - list[i]) # 待ち時間

max_iter = np.argmax(list_1)  # 最大インデックス
sum = list[max_iter]
del list[max_iter]
del list_1[max_iter]
sum = sum + np.sum(list) + np.sum(list_1)

Submission status: Wrong Answer

Solution code:
# A~Eの１の位が（0を除いて）最も小さいものを最後に頼めばよい
import numpy as np
A = np.zeros(5)
B = np.zeros(5)
time = 0
for i in range(5):
    A[i] = int(input())
    if A[i] % 10 == 0:
        B[i] = 10
    else:
        B[i] = A[i] % 10

for j in range(5):
    for k in range(j, 4):
        if B[k] > B[k + 1]:
            B[k], B[k + 1] = B[k + 1], B[k]
            A[k], A[k + 1] = A[k + 1], A[k]
time += A[0]
for h in range(1, 5):
    time += A[h]+10-B[h]
print("{}".format(int(time)))

Submission status: Wrong Answer

Solution code:
li = []
for i in range(5):
  li.append(int(input()))
mi = 1e10
ans = 0
for i in range(5):
  ans+=(li[i]//10)*(10+(li[i]%10!=0))
  if li[i]%10 != 0:
    mi = min(mi,li[i]%10)
print(ans - 10 + mi)

Submission status: Wrong Answer

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(A+B+C+D+E)
else:
  dishes=np.dstack([dishes, dishes_1])
  dishes=sorted(dishes, key=lambda x: x[1])
  dishes=dishes[0]
  for i in range(len(dishes)):
      if dishes[i][1]!=0:
          last=dishes[i]
          np.delete(dishes, [i], axis=0)
          break
  for j in range(len(dishes)):
      ans=ans+dishes[j][0]+((10-dishes[j][0]%10)%10)
  print(ans+last[0])

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 = [10-i%10 for i in l]
    print(sum(L) + cnt + (sum(l1) - max(l1)))
    exit()

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:
import math
n = [int(input()) for i in range(5)]
m = [n[i]%10 for i in range(5)]
l = [math.ceil(n[i]/10)*10 for i in range(5)]
if min(m) != 0:
  print(sum(l) -10 + min(m))
else:
  print(sum(l) + min(m))

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:
    if a % 10 == 0:
        a1.append(9)
    else:
        a1.append(a % 10)
    a //= 10

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

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

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

while e>0:
    if e % 10 == 0:
        e1.append(9)
    else:    
        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:
x = []

for i in range(5):
  x.insert(0, int(input()))
  if x[i]%10 != 0:
    x[i], x[0] = x[0], x[i]

for i in range(len(x)):
  for j in range(len(x)-1):
    if 10 - x[j]%10 > 10 - x[j+1]%10:
      if x[j]%10 != 0 and x[j+1]%10 != 0:
        x[j], x[j+1] = x[j+1], x[j]

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

print(ans)

Submission status: Wrong Answer

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

@author: yuta
"""

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

def main(x):
    rest = list(map(lambda y: 10 - y%10, x))
    for i in range(5):
        if rest[i] == 10:
            rest[i] == 0
    rest_sort = sorted(rest)
    t = sum(x) + sum(rest_sort[0:3])
    print(t)

main(ABCDE)