Five Dishes
https://atcoder.jp/contests/abc123/tasks/abc123_b
t6o_o6t.icon
この問題はメニューの順番を比較する
順番の列挙は、たぶん全探索でOK
$ 5! = 120通り?
Pythonのitertoolsで順列を取得
code: kaede0226.py
import itertools
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
times = A, B, C, D, E # 料理の待ち時間リスト
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)
変数名が良くないな