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
import math

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


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


A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
import numpy as np
import math

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.stack([dishes, dishes_1], 1)
  dishes=sorted(dishes, key=lambda x: x[1])
  print(dishes)
  for i in range(len(dishes)):
      if dishes[i][1]!=0:
          last=dishes[i]
          dishes.pop(i)
          break
  for j in range(len(dishes)):
      ans=ans+dishes[j][0]+((10-dishes[j][0]%10)%10)
  print(ans+last[0])


A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
import numpy as np
import math

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.stack([dishes, dishes_1], 1)
  dishes=sorted(dishes, key=lambda x: x[1])
  print(dishes)
  for i in range(len(dishes)):
      if dishes[i][1]!=0:
          last=dishes[i]
          dishes.pop(i)
          break
  for j in range(len(dishes)):
      ans=ans+dishes[j][0]+((10-dishes[j][0]%10)%10)
  print(ans+last[0])


import numpy as np
import math

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


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=dishes[0]
  dishes=sorted(dishes, key=lambda x: x[1])
  for i in range(len(dishes)):
      if dishes[i][1]!=0:
          last=dishes[i]
          dishes=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])


Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted