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

nums = []
sortedNums = [0,0,0,0,0]
sortedRemainders = [0,0,0,0,0]
for i in range(5):
	nums.append(int(input()))

remainders = [0,0,0,0,0]
for i in range(5):
	if nums[i] % 10 == 0:
		remainders[i] = 10
	else:
		remainders[i] = nums[i] % 10

sortedRemaindersIndex = np.ndarray.tolist(np.argsort(remainders))

for i in range(5):
	sortedNums[i] = nums[sortedRemaindersIndex[i]]

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

elapsedTime += sortedNums[0]

print(elapsedTime)

import numpy as np

nums = []
sortedNums = [0,0,0,0,0]
sortedRemainders = [0,0,0,0,0]
for i in range(5):
	nums.append(int(input()))

remainders = [0,0,0,0,0]
for i in range(5):
	remainders[i] = nums[i] % 10

sortedRemaindersIndex = np.ndarray.tolist(np.argsort(remainders))

for i in range(5):
	sortedRemainders[i] = remainders[sortedRemaindersIndex[i]]
	sortedNums[i] = nums[sortedRemaindersIndex[i]]

print(sortedRemainders)
print(sortedNums)

elapsedTime = 0
lastIndex = 0
foundLastIndex = False
for i in range(5):
	if sortedRemainders[i] == 0:
		elapsedTime += sortedNums[i]
	else:
		if foundLastIndex:
			elapsedTime += sortedNums[i] + 10 - sortedRemainders[i]
		else:
			lastIndex = i
			foundLastIndex = True
	print(elapsedTime)

elapsedTime += sortedNums[lastIndex]

print(elapsedTime)

numberOfToorists = int(input())

minimumCapacity = 10.0**16

for i in range(5):
	vehicleCapacity = int(input())
	minimumCapacity = min(minimumCapacity, vehicleCapacity)

bottleNeckTime = numberOfToorists / minimumCapacity
if numberOfToorists % minimumCapacity > 0:
	bottleNeckTime += 1

requiredTime = bottleNeckTime + 4

print(requiredTime)

import numpy as np

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

remainders = [0,0,0,0,0]
for i in range(5):
	remainders[i] = nums[i] % 10

sortedRemainders = np.argsort(remainders)

for i in range(5):
	sortedNums[i] = nums[sortedRemainders[i]]

elapsedTime = 0
for i in range(4):
	if sortedRemainders[i] == 0:
		elapsedTime += sortedNums[i]
	else:
		elapsedTime += sortedNums[i] + 10 - sortedRemainders

elapsedTime += sortedNums[4]

print(elapsedTime)

import numpy as np

nums = []
sortedNums = [0,0,0,0,0]
sortedRemainders = [0,0,0,0,0]
for i in range(5):
	nums.append(int(input()))

remainders = [0,0,0,0,0]
for i in range(5):
	if nums[i] % 10 == 0:
		remainders[i] = 10
	else:
		remainders[i] = nums[i] % 10

sortedRemaindersIndex = np.ndarray.tolist(np.argsort(remainders))

for i in range(5):
	sortedNums[i] = nums[sortedRemaindersIndex[i]]

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

elapsedTime += sortedNums[0]

print(elapsedTime)

import numpy as np

nums = []
sortedNums = [0,0,0,0,0]
sortedRemainders = [0,0,0,0,0]
for i in range(5):
	nums.append(int(input()))

remainders = [0,0,0,0,0]
for i in range(5):
	if nums[i] % 10 == 0:
		remainders[i] = 10
	else:
		remainders[i] = nums[i] % 10

sortedRemaindersIndex = np.ndarray.tolist(np.argsort(remainders))

for i in range(5):
	sortedNums[i] = nums[sortedRemaindersIndex[i]]

elapsedTime = 0
for i in range(4):
	if sortedNums[i+1] % 10 == 0:
		elapsedTime += sortedNums[i+1]
	else:
		elapsedTime += int((sortedNums[i+1]/10 +1) * 10)

elapsedTime += sortedNums[0]

print(elapsedTime)

import numpy as np

nums = []
sortedNums = [0,0,0,0,0]
sortedRemainders = [0,0,0,0,0]
for i in range(5):
	nums.append(int(input()))

remainders = [0,0,0,0,0]
for i in range(5):
	remainders[i] = nums[i] % 10

sortedRemaindersIndex = np.ndarray.tolist(np.argsort(remainders))

for i in range(5):
	sortedRemainders[i] = remainders[sortedRemaindersIndex[i]]
	sortedNums[i] = nums[sortedRemaindersIndex[i]]

print(sortedRemainders)
print(sortedNums)

elapsedTime = 0
lastIndex = 0
foundLastIndex = False
for i in range(5):
	if sortedRemainders[i] == 0:
		elapsedTime += sortedNums[i]
	else:
		if foundLastIndex:
			elapsedTime += sortedNums[i] + 10 - sortedRemainders[i]
		else:
			lastIndex = i
			foundLastIndex = True
	print(elapsedTime)

elapsedTime += sortedNums[lastIndex]

print(elapsedTime)

import numpy as np

nums = []
sortedNums = [0,0,0,0,0]
sortedRemainders = [0,0,0,0,0]
for i in range(5):
	nums.append(int(input()))

remainders = [0,0,0,0,0]
for i in range(5):
	if nums[i] % 10 == 0:
		remainders[i] = 10
	else:
		remainders[i] = nums[i] % 10

sortedRemaindersIndex = np.ndarray.tolist(np.argsort(remainders))

for i in range(5):
	sortedNums[i] = nums[sortedRemaindersIndex[i]]

elapsedTime = 0
for i in range(4):
	if sortedNums[i+1] % 10 == 0:
		elapsedTime += sortedNums[i+1]
	else:
		elapsedTime += sortedNums[i+1] + 10 - sortedNums[i+1] % 10

elapsedTime += sortedNums[0]

print(elapsedTime)

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Accepted