Problem: 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.

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

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

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)

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)

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)


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)

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)


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

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

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

print(minute)


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


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)

import math

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

tlist = [A, B, C, D, E]
mod_list = [A % 10, B % 10, C % 10, D % 10, E % 10]
mod_list_2 = mod_list[:]
count = 0
already = 0

while 0 in mod_list_2:
  mod_list_2.pop(mod_list_2.index(0))
  
min_mod = 0
if mod_list_2:
  min_mod = min(mod_list_2)
  
if min_mod == 0:
  print(A + B + C + D + E)
else:
  for i in tlist:
    if (i % 10 == min_mod) and already == 0:
      already = i
    else:
      count += int(math.ceil(i / 10) * 10)
  else:
    count += already
    print(count)
  




Verdicts: Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Accepted