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:
l,s = [],[]
for i in range(5):
    num = int(input())
    l.append(num)
    s.append(num%10)
res = 0
s = list(set(s))
if 0 in s:
    s.remove(0)
for i in l:
    if i%10!=0:
        res += (i+10)//10*10
    else:
        res += i
else:
    print(res-(10-min(s)))

Submission status: Runtime Error

Solution code:
A = []
B = []
for i in range(5):
    x = input()
    if int(x[-1]) != 0:
        A.append(10 - int(x[-1]))
    B.append(int(x))

print(sum(A) + sum(B) - max(A))

Submission status: Runtime Error

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

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

import math

times = [ math.ceil(a/10)*10,
          math.ceil(b/10)*10,
          math.ceil(c/10)*10,
          math.ceil(d/10)*10,
          math.ceil(e/10)*10 ]

digit1 = [a - a//10*10,
          b - b//10*10,
          c - c//10*10,
          d - d//10*10,
          e - e//10*10]

m = 10
tt = 0
idx = 99

for i in range(5):
    tt += times[i]
    if 0 < digit1[i] and digit1[i] < m:
        m = digit1[i]
        idx = i

print('{}'.format(tt - times[idx] + v[idx]))

Submission status: Runtime Error

Solution code:
lis = []
for i in range(5):
    lis.append(int(input()))
plus = 0
notdiv = []
for i in range(5):
    if lis[i] % 10 != 0:
        plus += 10 - (lis[i] % 10)
        notdiv.append(lis[i])
for i in range(len(notdiv)):
    notdiv[i] %= 10
    notdiv[i] = 10 - notdiv[i]

notdiv.sort()
print(sum(lis) + plus - notdiv[-1])

Submission status: Runtime Error

Solution code:

import math

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

last = 9

all = []

all.append(a%10)
all.append(b%10)
all.append(c%10)
all.append(d%10)
all.append(e%10)


for m, i in enumerate(all):
    # print(i)
    temp = i
    if temp < last and temp !=0:
        last = temp
        index = m

# print("index:" + str(index))
a = a/10
b = b/10
c = c/10
d = d/10
e = e/10

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

sum = 0
for k, j in enumerate(All):
    # print(k)

    if k == index:
        # print(k)
        sum += j *10
    else:
        sum += math.ceil(j)*10

sum = int(sum)
print(sum)

Submission status: Runtime Error

Solution code:
def rest(num):
    return num % 10

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
Foods = [A,B,C,D,E]
res = 0

poplist=[]
for idx in range(5):
    if Foods[idx]%10==0:
        res += Foods[idx]
        poplist.append(idx)
while len(poplist)>0:
    idx = max(poplist)
    Foods.pop(idx)
    poplist.pop(idx)

while len(Foods) > 0:
    idx = Foods.index(max(Foods, key=rest))
    if len(Foods)>1:
        res += (Foods[idx]//10)*10+10
    else:
        res += Foods[idx]
    Foods.pop(idx)



print(res)

Submission status: Runtime Error

Solution code:
a=[]
for i in range(5):
  a.append(input())
b=[]
for j in range(5):
  if a[j]%10==0:
    b.append(10)
  else:
    b.append(a[j]%10)
idx=b.index(min(b))
cnt=a[idx]
del a[idx]
for k in range(4):
  if a[k]%10==0:
    cnt+=a[k]
  else:
    cnt+=a[k]+10-(a[k]%10)
print(cnt)

Submission status: Runtime Error

Solution code:
lis = []
for i in range(5):
    lis.append(int(input()))
plus = 0
notdiv = []
for i in range(5):
    if lis[i] % 10 != 0:
        plus += 10 - (lis[i] % 10)
        notdiv.append(lis[i])
for i in range(5):
    notdiv[i] %= 10
    notdiv[i] = 10 - notdiv[i]


notdiv.sort()
print(sum(lis) + plus - notdiv[-1])

Submission status: Runtime Error

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

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

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

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

Submission status: Runtime Error

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

last = 10

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


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


print(ans)

Submission status: Runtime Error

Solution code:
ts = []
ts_mod = []
for i in range(5):
    ts.append(int(input()))
    ts_mod.append(ts[i] % 10)


def find_index(ts, ts_mod):
    result = 10
    for i in range(len(ts_mod)):
        if ts_mod[i] == 0:
            pass
        else:
            if result > ts_mod[i]:
                result = ts_mod[i]
    return ts_mod.index(result)

min_ind = find_index(ts, ts_mod)

last_ts = ts[min_ind]

del ts_mod[min_ind]
del ts[min_ind]


result = 0
for i in range(len(ts_mod)):
    if ts[i] % 10 == 0:
        result += ts[i]
    else:
        result += ts[i] + ( 10 - ts[i] % 10 )
        
result += last_ts
print(result)

Submission status: Runtime Error

Solution code:
a = list(map(int, [input() for i in range(5)]))
b = [math.ceil(b / 10) * 10 for b in a]

c1 = b[0] + b[1] + b[2] + b[3] + a[4]
c2 = b[0] + b[1] + b[2] + a[3] + b[4]
c3 = b[0] + b[1] + a[2] + b[3] + b[4]
c4 = b[0] + a[1] + b[2] + b[3] + b[4]
c5 = a[0] + b[1] + b[2] + b[3] + b[4]

print(min([c1, c2, c3, c4, c5]))

Submission status: Runtime Error

Solution code:
from math import ceil
minutes = [int(input()) for _ in range(5)]

x = min([(x, x%10) for x in minutes if x%10 != 0], key=lambda x: x[1])

minutes.remove(x[0])
print(sum([ceil(x/10)*10 for x in minutes])+x[0])

Submission status: Runtime Error

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

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

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

print(t - max(amari))

Submission status: Runtime Error

Solution code:
l,s = [],[]
for i in range(5):
    num = int(input())
    l.append(num)
    s.append(num%10)
res = 0
s = list(set(s))
if 0 in s:
    s.remove(0)
for i in l:
    res += ((i+9)//10*10)
else:
    print(res-(10-min(s)))

Submission status: Runtime Error

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

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

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

print(lastorder)

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

print(ans)

Submission status: Runtime Error

Solution code:
A=[]
Y = []
for i in range(5):
    x = int(input())
    y = x % 10
    x = x + (10-y)
    A.append((y,x))

B = sorted(A):
sum = 0

for i in range(len(B)):
    x,y = B[i]
    sum += x
    if i == len(B)-1:
        sum -= y

print(sum)

Submission status: Runtime Error

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

mod = 10
for s in range(5):
	tmp = i[s] % 10
	if tmp!=0:
		if mod > tmp:
			mod=tmp
			last=s
sum=0
for s in range(5):
  if(s!=last):
    tmp=i[s] // 10
    mod=i[s] % 10
    if mod >0:
      sum+=tmp + 1
    else:
      sum+=tmp
print(sum*10 +i[last])

Submission status: Runtime Error

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

time = 0
non10li = []
for i in li:
    if i%10==0:
        time+=i
    else:
        non10li.append(i)

minili = [i%10 for i in non10li]
ind = non10li.pop(minili.index(min(minili)))
for i in non10li:
    time+=(i//10)*10+10

time+=ind
print(time)

Submission status: Runtime Error

Solution code:
# coding: utf-8

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

min_index = min([(i, d % 10) for i, d in enumerate(dishes) if d % 10 != 0], key=lambda x: x[1])[0]
min_dish = dishes[min_index]
dishes.remove(min_dish)
cooking_time = [d + 10 - (10 if d % 10 == 0 else (d % 10)) for d in dishes]
print(sum(cooking_time) + min_dish)

Submission status: Runtime Error

Solution code:
A_list = []
for i in range(5):
    A_list.append(input())
one_list = []
one_list.append(int(A_list[0][-1]))
one_list.append(int(A_list[1][-1]))
one_list.append(int(A_list[2][-1]))
one_list.append(int(A_list[3][-1]))
one_list.append(int(A_list[4][-1]))
min_num = max(one_list)
for i in range(len(one_list)):
    if one_list[i] != 0 and min_num >= one_list[i]:
        min_num = one_list[i]
        min_one_list_index = i
A_list_min = A_list[min_one_list_index]
del A_list[min_one_list_index]


def ceil(src, range):
    if src % 10 == 0:
        return src
    else:
        return ((int)(src / range) + 1 ) * range


for i in range(len(A_list)):
    A_list[i] = ceil(int(A_list[i]), 10)
print(sum(A_list)+int(A_list_min))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import sys


def main():
    input = sys.stdin.readline
    ryori_list = [int(input()) for _ in range(5)]
    loss_list = [10 - (r % 10) for r in ryori_list if r % 10]
    print(sum(ryori_list) + sum(loss_list) - max(loss_list))


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
dct = {}
d = {}
d2 = {}
ll = [0,1,2,3,4]

for i in range(5):
    inp = int(input())
    if inp % 10 != 0:
        d[i] = inp % 10
        d2[i] = inp
        dct[i] = int(inp/10)*10+10
    else:
        dct[i] = inp

last = sorted(d.items(), key=lambda x: x[1])[0][0]

ll.remove(last)

ans = d2[last]

for i in ll:
    ans += dct[i]

print(ans)

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
list1=[A,B,C,D,E]
sum=0
for item in list1:
  if(w%10==0):
    sum+=w
  else:
    sum=sum+(10-w%10)
print(sum)

Submission status: Runtime Error

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

l = [a,b,c,d,e]
nl = []
ans = 0
for t in l:
  if t%10 == 0:
    ans += t
  else:
    nl.append(t)
    
nl = sorted(nl, key=lambda x: x%10, reverse=True)

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

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

Submission status: Runtime Error

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

for i in range(5):
  ra.append(a[i]%10)

rmin=10
mi=10
for i in range(5):
  if ra[i]!=0 and ra[i]<rmin:
    rmin=ra[i]
    mi=i
    
mintime=0
for i in range(5):
  if ra[i]==0:
    mintime+=a[i]
  else:
    mintime+=a[i]+10-ra[i]
mintime-=10-ra[mi]
print(mintime)

Submission status: Runtime Error

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

time  = time + md
print(time)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

orderlist = [aa,bb,cc,dd,ee]

orderlist.sort()

lastorder = orderlist[4]
print(lastorder)

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
l = [str(input()) for i in range(5)]
tmp = []
total = 0
a = []
b = []
c = []
for n in l:
    tmp.append([n,n[-1]])
for k, v in sorted(tmp, key=lambda x: x[1], reverse=True):
    if int(v) == 0:
        b.append([int(k), int(v)])
    else:
        a.append([int(k), int(v)])
c.append(a[-1]) 
a = a[:-1]
for i in a:
    total += i[0] + 10 - i[1]
for i in b:
    total += i[0]
total += c[0][0]
print(total)

Submission status: Runtime Error

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

for i in range(len(order)):
  time = 0
  for j in range(len(order)-i):
    if order[j+i]%10 == 0:
    	time += order[j]
  	else:
    	time += (order[j]//10+1)*10

Submission status: Runtime Error

Solution code:
dish = []
for i in range(5):
    dish.append(int(input()))
print(sum([d // 10 + (d % 10 > 0) for d in dish]) * 10 + sorted([d % 10 for d in dish if d % 10 > 0])[0] - 10)

Submission status: Runtime Error

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

s=0
for i in range(1,5,1):
  s+=Listn[i]

S+=s
print(S)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
ans = 0
l = []
for i in a,b,c,d,e:
    k = 10-i%10
    if k != 10:
        l.append(k)
l.pop(l.index(max(l)))
ans = a + b + c + d + e + sum(l)
print(ans)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main() {
  vector<int> spot(5,0);
  for (int i = 0; i < 5; i++) {
	cin >> spot[i];
  }
  
  int check = 0;
  int maxS = 0;
  vector<int> left(5,0);
  int total = 0;

  for (int i = 0; i < 5; i++) {
	left.at(i) = spot.at(i) % 10;
	if (left.at(i) == 0) {
		left.at(i) = 0;
	} else {
		left.at(i) = 10 - left.at(i);
	}
  }

  maxS = max({left.at(0),left.at(1),left.at(2),left.at(3),left.at(4)});
  for (int i = 0; i < 5; i++) {
	if (maxS == left.at(i)) {
		check = i;
	}
  }

  
  for (int i = 0; i < 5; i++) {
	if (check == i) {
		total = total + spot.at(i);
	} else {
		total = total + spot.at(i) + left.at(i);
	}
  }

  cout << total << endl;
}

Submission status: Runtime Error

Solution code:
li = [int(input()) for i in range(5)]
for i in range(1,10):
    for j in range(5):
        if li[j] % 10 == i:
            a = li[j]
            del li[j]
            break
    else:
        continue
    break

for i in range(4):
    if li[i] % 10 != 0:
        li[i] = (li[i] // 10 + 1) * 10
print(sum(li) + a)

Submission status: Runtime Error

Solution code:
lst_str = [input() for _ in range(5)]
lst_int = [int(x) for x in lst_str]

sum_lst = sum(lst_int)

lst_diff = []
for i in lst_str:
    val = int(i[-1])
    if val != 0:
        lst_diff.append(10 - val)

diff = sum(lst_diff) - max(lst_diff)

ans = sum_lst + diff
print(ans)

Submission status: Runtime Error

Solution code:
import math

i = []
for l in range(5):
    i.append(int(input()))
m = -1
l = 0
for x in range(5):
    if m < (10 - i[x] % 10) and 10 - i[x] % 10 != 10:
        if x != 0:
            l += math.ceil(i[mx] / 10) * 10
        m = 10 - i[x] % 10
        mx = x
    else:
        l += math.ceil(i[x] / 10) * 10
l += i[mx]
print(l)

Submission status: Runtime Error

Solution 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 = [i%10 for i in list1]
min_item=9
for i in range(1,10):
    if i in list2:
        min_item = min(min_item,i)
min_index = list2.index(min_item)
total_time = 0
time_seq =[]

for i in range(5):
    if i == min_index:
        continue
    time1 = math.ceil(list1[i]/10) * 10
    total_time += time1
    time_seq.append(time1)
    
total_time += list1[min_index]
print(int(total_time))

Submission status: Runtime Error

Solution code:
A = [int(input()) for i in range(5)]
B = [A[i] % 10 for i in range(5)]
C = [10 - B[i] for i in range(5) if B[i] != 0]

ans = 0
for i in range(5):
    ans += A[i]
    if B[i]: ans += 10 - B[i]

print(ans - max(C))

Submission status: Runtime Error

Solution code:
import math
n = [int(input()) for i in range(6)]
temp = 9
answer = 0
for i in n:
  answer += math.ceil(i/10)*10
  if i % 10 < temp:
    temp = i % 10
print(answer - 10 + temp)

Submission status: Runtime Error

Solution code:
l = [str(input()) for i in range(5)]
dct = {}
total = 0
a = []
b = []
c = []
for n in l:
    dct[n] = n[-1]
for k, v in sorted(dct.items(), key=lambda x: x[1], reverse=True):
    if int(v) == 0:
        b.append([int(k), int(v)])
    else:
        a.append([int(k), int(v)])
c.append(a[-1]) 
a = a[:-1]
for i in a:
    total += i[0] + 10 - i[1]
for i in b:
    total += i[0]
total += c[0][0]
print(total)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
li = [a, b, c, d, e]
li_2 = []
d = 10
count = 0
adr = 0
for i in li:
    li_2.append(i % 10)
for i in li_2:
    if i < d and i != 0:
        d = i
        ans = adr
    adr += 1
if d == 10:
    d = 0
for i in range(5):
    if i != ans and li_2[i] != 0:
        count += (li[i] - li_2[i] + 10)
    elif i != ans and li_2[i] == 0:
        count += li[i]
count += li[ans]
print(count)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
inputs = []
inputs.append(int(input()))
inputs.append(int(input()))
inputs.append(int(input()))
inputs.append(int(input()))
inputs.append(int(input()))
amari_list = []
time = 0
for input in inputs:
  amari = input % 10
  if amari == 0:
    time += input
  else:
    time += (input // 10) * 10
    amari_list.append(amari)
time += (len(amari_list) - 1)*10
time += min(amari_list)
# 出力
print(time)

Submission status: Runtime Error

Solution code:
an = [int(input()) for i in range(5)]
total = 0

for i in range(5):
  tot = (an[i] // 10) * 10
  an[i] -= tot
  total += tot
  if an[i] == 0:
    del an[i]
if len(an) > 0:
  total += min(an) + (len(an) - 1)*10
print(total)

Submission status: Runtime Error

Solution code:
A_list = []
for i in range(5):
    A_list.append(input())
one_list = []
one_list.append(int(A_list[0][-1]))
one_list.append(int(A_list[1][-1]))
one_list.append(int(A_list[2][-1]))
one_list.append(int(A_list[3][-1]))
one_list.append(int(A_list[4][-1]))
min_num = max(one_list)
for i in range(len(one_list)):
    if one_list[i] != 0 and min_num >= one_list[i]:
        min_num = one_list[i]
        min_one_list_index = i
A_list_min = A_list[min_one_list_index]
del A_list[min_one_list_index]


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


for i in range(len(A_list)):
    A_list[i] = ceil(int(A_list[i]), 10)
print(sum(A_list)+int(A_list_min))

Submission status: Runtime Error

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

order_1 = [i*0.1 - int(i*0.1) for i in ryouri]
min_v = sorted(order_1)[0]
min_id = 0
for i, v in enumerate(order_1):
    if v == min_v:
        min_id = i

goukei = 0
for i, (price, order) in enumerate(zip(ryouri, order_1)):
    if i == min_id:
        goukei = goukei + ryouri
    else:
        goukei = goukei + ryouri + 10

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
array=[A,B,C,D,E]
sum=0
for　index in array:
  if(gindex%10==0):
    sum+=index
  else:
    sum=sum+(10-index%10)
print(sum)

Submission status: Runtime Error

Solution code:
an = [int(input()) for i in range(5)]
total = 0

for i in range(5):
  tot = (an[i] // 10) * 10
  an[i] -= tot
  total += tot
  if an[i] == 0:
    del an[i]
if an:
  total += min(an) + (len(an) - 1)*10
print(total)

Submission status: Runtime Error

Solution code:
from math import ceil
ts = [int(input()) for _ in range(5)]
m = 10 - min([t % 10 for t in ts if not t % 10 == 0])
tss = [ceil(t / 10) * 10 for t in ts]
print(sum(tss) - m)

Submission status: Runtime Error

Solution code:
a=list()
for i in range(5):
  a.append(int(input()))
max=10
count=0
for i in range(5):
  if a[i]%10<max and a[i]%10!=0:
    max=a[i]%10
    maxI=i
for i in range(5):
  if i!=maxI:
    count+=a[i]
    if a[i]%10!=0:
      count+=(10-a[i]%10)
count+=a[maxI]
print(count)

Submission status: Runtime Error

Solution code:
T = []
for i in range(5):
    T.append(input())
tmp = []
for i in range(5):
    tmp.append(10 - int(T[i][-1]))
minlist = []
for i in range(5):
    if tmp[i] > 4:
        minlist.append(tmp[i])
    else:
        minlist.append(10)
last = tmp.index(min(minlist))
tmp2 = [0 if x == 10 else x for x in tmp]
ans = []
for i in range(5):
    ans.append(tmp2[i] + int(T[i]))
print(sum(ans) - ans[last] + int(T[last]))

Submission status: Runtime Error

Solution code:
lst_str = [input() for _ in range(5)]
lst_int = [int(x) for x in lst_str]

sum_lst = sum(lst_int)

lst_diff = []
for i in lst_str:
    val = 10 - int(i[-1])
    if val != 10:
        lst_diff.append(val)

diff = sum(lst_diff) - max(lst_diff)

ans = sum_lst + diff
print(ans)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
l=[a,b,c,d,e]
lastindex=0
tenmod=[a%10,b%10,c%10,d%10,e%10]
times=tenmod.count(0)
for i in range(times):
  tenmod.remove(0)
key=min(tenmod)
alltime=0
for i in range(5):
  if l[i]%10==0:
    alltime+=l[i]
  elif l[i]%10==key:
    alltime+=l[i]
  else:
    alltime+=int(l[i]/10)*10+10
print(alltime)

Submission status: Runtime Error

Solution code:
import math
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
l = [a, b, c, d, e]
ans = 9
n = 9
j = 0
for i in [i % 10 for i in l]:
    if i != 0 and i < ans:
        ans = i
        n = j
    j += 1
m = l.pop(n)
r = 0
for i in l:
    r += math.ceil(i / 10) * 10
print(r + m)

Submission status: Runtime Error

Solution code:
a = int(input())                                                        
b = int(input())                                                        
c = int(input())                                                        
d = int(input())                                                        
e = int(input())                                                        
                                                                        
orders = [a, b, c, d, e]                                                
orders = list(map(str, orders))                                         
orders = sorted(orders, key=lambda x:int(x[-1]))                        
                                                                        
a = []                                                                  
b = []                                                                  
for order in orders:                                                    
    if order[-1] == "0":                                                
        a.append(int(order))                                            
    else:                                                               
        b.append(order)                                                 
                                                                        
o = sum(a) + int(b[0]) + sum([10-int(_b[-1])+int(_b) for _b in b[1:]])  
print(o)

Submission status: Runtime Error

Solution code:
import math


def main():
    ans = 0
    t = []
    for _ in range(5):
        x = input()
        if x[-1] == '0':
            ans += int(x)
        else:
            t.append(int(x))
    t.sort(key=lambda x: str(x)[-1])
    for i in range(1, len(t)):
        ans += math.ceil(t[i] / 10) * 10
    ans += t[0]
    print(ans)


main()

Submission status: Runtime Error

Solution code:
a = []

for i in range(5):
    a.append(int(input()))


def ceil10(n):
    if n % 10 == 0:
        return n
    else:
        return ((n // 10) + 1) * 10


def min_1(a):
    a2 = list(filter(lambda a: a > 0, (map(lambda e: e % 10, a))))

    return min(a2)


ans = sum(map(ceil10, a)) - 10 + min_1(a)
print(ans)

Submission status: Runtime Error

Solution code:
ten = a//10 + b//10 + c//10 + d//10 + e//10

aa = [a%10,b%10,c%10,d%10,e%10]
zero = aa.count(0)

if zero == 5:
	print(ten)
else:
	for i in range(1,10):
		if  i in aa:
			one = i
			break
	print(ten*10 + (4-zero)*10 +one)

Submission status: Runtime Error

Solution code:
an = [int(input()) for i in range(5)]
total = 0

for i in range(5):
  tot = (an[i] // 10) * 10
  an[i] -= tot
  total += tot
  if an[i] == 0:
    del an[i]
    
total += min(an) + (len(an) - 1)*10
print(total)

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
f=[A,B,C,D,E]
sum=0
for　g in f:
  if(g%10==0):
    sum+=g
  else:
    sum=sum+(10-g%10)
print(sum)

Submission status: Runtime Error

Solution code:
import math

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

ans=[10-i%10 for i in data]
check=ans.index(max(ans))
X=data.pop(check)

data=[math.ceil(x/10)*10 for x in data]
print(sum(data)+X

Submission status: Runtime Error

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

list = [A,B,C,D,E]
num =[]
num_t = []
for i in range(len(list)):
    s = 0
    t = 0
    if list[i] >= 100:
        s = list[i] - 100
        t = 100
    else:
        s = list[i]
    while s >= 10:
        s -= 10
        t += 10
    num.append(s)
    if s != 0:
        t += 10
    num_t.append(t)
    
last_index = len(num)
for i in range(len(num)):
    if num[i] != 0:
        if num[i] <= last_index:
            last_index = i

sum = 0
for i in range(len(num_t)):
    sum += num_t[i]
    
sum = sum - num_t[last_index] + list[last_index]
print(sum)

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <iterator>
#include <algorithm>
#include <string>
#include <cstring>
using namespace std;

template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
    vector.erase(vector.begin() + index);
}

#define rep(i, n, m) for (int i = n; i <= m; i++)
#define Rep(i, n, m) for (int i = m; i >= 1; i--)

typedef long long ll;

int main() {
    vector<int> an(5);
    vector<int> a1(5);
    rep(i, 0, 4)  {
        cin>> an[i];
        a1[i] = an[i] % 10;
    }
    int ans = 0, b = 0;
    decltype(a1)::iterator minf = min_element(a1.begin(), a1.end());
    rep(i, 0, 4) {
        if (a1[i] != *minf) {
            ans += (an[i] / 10 + 1) * 10;
            cout << "i : " << ans << " : " << an[i] << endl;
        } else {
            b = an[i];
        }
    }
    cout << ans + b << endl;
}

Submission status: Runtime Error

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

orders = [A, B, C, D, E]
max_fp = 10
ans = 0

for i, order in enumerate(orders):
    if order % 10 < max_fp and order % 10 != 0:
        max_fp = order % 10
        last_order = i

for i, order in enumerate(orders):
    if i == last_order or order % 10 == 0:
        ans += order
    else:
        ans += (order // 10 + 1) * 10

print(ans)

Submission status: Runtime Error

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


ten = a//10 + b//10 + c//10 + d//10 + e//10

aa = [a%10,b%10,c%10,d%10,e%10]
zero = aa.count(0)

if zero == 5:
	print(ten)
else:
	for i in range(1,9):
		if  i in aa:
			one = i
			break
	print(ten*10 + (4-zero)*10 +one)