結果

問題 No.27 板の準備
ユーザー roiti46roiti46
提出日時 2015-02-18 02:30:57
言語 Python2
(2.7.18)
結果
AC  
実行時間 2,556 ms / 5,000 ms
コード長 425 bytes
コンパイル時間 1,225 ms
コンパイル使用メモリ 6,680 KB
実行使用メモリ 6,144 KB
最終ジャッジ日時 2023-08-27 03:31:20
合計ジャッジ時間 46,877 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2,129 ms
6,040 KB
testcase_01 AC 2,189 ms
5,940 KB
testcase_02 AC 2,257 ms
5,924 KB
testcase_03 AC 2,152 ms
6,052 KB
testcase_04 AC 2,339 ms
5,988 KB
testcase_05 AC 2,556 ms
5,920 KB
testcase_06 AC 2,451 ms
5,940 KB
testcase_07 AC 2,450 ms
5,940 KB
testcase_08 AC 2,552 ms
5,992 KB
testcase_09 AC 2,437 ms
5,984 KB
testcase_10 AC 2,360 ms
5,928 KB
testcase_11 AC 2,347 ms
5,912 KB
testcase_12 AC 2,405 ms
6,124 KB
testcase_13 AC 2,289 ms
6,048 KB
testcase_14 AC 2,234 ms
6,144 KB
testcase_15 AC 2,287 ms
6,052 KB
testcase_16 AC 2,224 ms
5,928 KB
testcase_17 AC 2,342 ms
5,992 KB
権限があれば一括ダウンロードができます

ソースコード

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