結果

問題 No.27 板の準備
ユーザー roiti46roiti46
提出日時 2015-02-18 02:30:40
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 226 ms / 5,000 ms
コード長 425 bytes
コンパイル時間 2,154 ms
コンパイル使用メモリ 77,440 KB
実行使用メモリ 79,760 KB
最終ジャッジ日時 2023-08-27 03:25:56
合計ジャッジ時間 6,226 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
79,196 KB
testcase_01 AC 135 ms
79,760 KB
testcase_02 AC 196 ms
79,576 KB
testcase_03 AC 144 ms
79,592 KB
testcase_04 AC 203 ms
79,272 KB
testcase_05 AC 198 ms
79,272 KB
testcase_06 AC 207 ms
79,424 KB
testcase_07 AC 211 ms
79,260 KB
testcase_08 AC 226 ms
79,624 KB
testcase_09 AC 215 ms
79,232 KB
testcase_10 AC 203 ms
79,284 KB
testcase_11 AC 210 ms
79,584 KB
testcase_12 AC 208 ms
79,216 KB
testcase_13 AC 193 ms
79,488 KB
testcase_14 AC 194 ms
79,264 KB
testcase_15 AC 211 ms
79,444 KB
testcase_16 AC 143 ms
79,444 KB
testcase_17 AC 215 ms
79,424 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