Five Dishes
t6o_o6t.icon
この問題はメニューの順番を比較する
順番の列挙は、たぶん全探索でOK
$ 5! = 120通り?
code: kaede0226.py
import itertools
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
min_time = 100000000 # 料理がすべて到着する最短タイム
for pattern in itertools.permutations(times, 5):
current = 0
for time in pattern:
if current % 10 != 0:
current += (10 - (current % 10)) # 10の倍数でなかったら、待つ
current += time # 料理の待機時間を加算
if min_time > current:
min_time = current # 最短タイムを更新する
print(min_time)