結果

問題 No.268 ラッピング(Easy)
ユーザー lam6er
提出日時 2025-03-20 18:44:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 34 ms / 5,000 ms
コード長 402 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 82,216 KB
実行使用メモリ 53,704 KB
最終ジャッジ日時 2025-03-20 18:44:40
合計ジャッジ時間 1,153 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

# Read input
L = list(map(int, input().split()))
R, B, Y = map(int, input().split())

min_total = float('inf')

# Try all permutations of the dimensions
for a, b, c in permutations(L):
    # Calculate the total length for this permutation
    total = 2 * (R * (a + c) + B * (a + b) + Y * (b + c))
    if total < min_total:
        min_total = total

print(min_total)
0