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

l = [A,B,C,D,E]
l = sorted(l)
# print(l)
ans = 0
tl = []
for v in l:
    temp = v % 10
    while temp > 10:
        temp = v % 10
    if temp == 0:
        temp = 100
    tl.append(temp)
# print(tl)
tt = []
for i in range(5):
    tt.append([l[i], tl[i]])

# print(tt)
tt.sort(key=lambda x:x[0],reverse=True)
tt.sort(key=lambda x:x[1],reverse=True)

print(tt)
a = tl.index(min(tl))
# print(a)
# print(l)
l = [x[0] for x in tt]
# print(l)
for i,v in enumerate(l):
    if i != len(l) - 1:
        temp = v % 10
        temp = 10 - temp + v
        ans = ans + temp
    else:
        ans = ans + v

print(ans)

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

l = [A,B,C,D,E]
l = sorted(l)
# print(l)
ans = 0
tl = []
for v in l:
    temp = v % 10
    while temp > 10:
        temp = v % 10
    if temp == 0:
        temp = 100
    tl.append(temp)
# print(tl)
tt = [tl,l]

a = tl.index(min(tl))
# print(l)

for i,v in enumerate(l):
    if i != a:
        temp = v % 10
        temp = 10 - temp + v
        ans = ans + temp
    else:
        ans = ans + v

print(ans)

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

l = [A,B,C,D,E]
l = sorted(l)
# print(l)
ans = 0
tl = []
for v in l:
    temp = v % 10
    while temp > 10:
        temp = v % 10
    if temp == 0:
        temp = 100
    tl.append(temp)
# print(tl)
tt = []
for i in range(5):
    tt.append([l[i], tl[i]])

# print(tt)
tt.sort(key=lambda x:x[0],reverse=True)
tt.sort(key=lambda x:x[1],reverse=True)

print(tt)
a = tl.index(min(tl))
# print(a)
# print(l)
l = [x[0] for x in tt]
# print(l)
for i,v in enumerate(l):
    if i != len(l) - 1:
        temp = v % 10
        temp = 10 - temp + v
        ans = ans + temp
    else:
        ans = ans + v

print(ans)

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

l = [A,B,C,D,E]
ans = 0
tl = []
for v in l:
    temp = v % 10
    while temp > 10:
        temp = v % 10
    if temp == 0:
        temp = 100
    tl.append(temp)
# print(tl)
tt = [tl,l]

a = tl.index(min(tl))
# print(a)
# print(l)

for i,v in enumerate(l):
    if i != a:
        temp = v % 10
        temp = 10 - temp + v
        ans = ans + temp
    else:
        ans = ans + v

print(ans)

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

l = [A,B,C,D,E]
l = sorted(l)
# print(l)
ans = 0
tl = []
for v in l:
    temp = v % 10
    while temp > 10:
        temp = v % 10
    if temp == 0:
        temp = 100
    tl.append(temp)
# print(tl)
tt = []
for i in range(5):
    tt.append([l[i], tl[i]])

# print(tt)
tt.sort(key=lambda x:x[0])
tt.sort(key=lambda x:x[1],reverse=True)
# print(tt)
a = tl.index(min(tl))
# print(a)
# print(l)
l = [x[0] for x in tt]
# print(l)
for i,v in enumerate(l):
    if i != len(l) - 1:
        temp = v % 10
        temp = 10 - temp + v
        ans = ans + temp
    else:
        ans = ans + v

print(ans)

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

l = [A,B,C,D,E]
l = sorted(l)
# print(l)
ans = 0
tl = []
for v in l:
    temp = v % 10
    while temp > 10:
        temp = v % 10
    if temp == 0:
        temp = 100
    tl.append(temp)
# print(tl)
tt = []
for i in range(5):
    tt.append([l[i], tl[i]])

# print(tt)
tt.sort(key=lambda x:x[0])
tt.sort(key=lambda x:x[1],reverse=True)

# print(tt)
a = tl.index(min(tl))
# print(a)
# print(l)
l = [x[0] for x in tt]
# print(l)
for i,v in enumerate(l):
    if i != len(l) - 1:
        temp = v % 10
        if temp != 0:
            temp = 10 - temp + v
        else:
            temp = v
        ans = ans + temp
    else:
        ans = ans + v
    # print(ans)

print(ans)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted