結果

問題 No.27 板の準備
ユーザー roiti46
提出日時 2015-02-18 02:30:57
言語 Python2
(2.7.18)
結果
AC  
実行時間 2,723 ms / 5,000 ms
コード長 425 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 6,784 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-12-26 10:41:07
合計ジャッジ時間 47,942 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools as it
V = map(int,raw_input().split())

ans = 1000
for a,b,c in it.product(range(1,31),repeat = 3):
    tmp = 0
    for Vi in V:
        need = 1000
        for i in range(31):
            for j in range(31):
                rem = Vi-i*a-j*b
                if rem < 0: break
                if rem%c == 0:
                    need = min(need,i+j+rem/c)
        tmp += need
    ans = min(ans, tmp)
print ans
0