結果

問題 No.27 板の準備
ユーザー chocoruskchocorusk
提出日時 2020-09-08 11:14:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 163 ms / 5,000 ms
コード長 332 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 10,888 KB
実行使用メモリ 8,284 KB
最終ジャッジ日時 2023-08-19 17:34:46
合計ジャッジ時間 4,010 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 163 ms
8,064 KB
testcase_01 AC 156 ms
8,076 KB
testcase_02 AC 156 ms
8,216 KB
testcase_03 AC 155 ms
8,152 KB
testcase_04 AC 158 ms
8,284 KB
testcase_05 AC 156 ms
8,060 KB
testcase_06 AC 155 ms
8,068 KB
testcase_07 AC 160 ms
8,132 KB
testcase_08 AC 158 ms
8,232 KB
testcase_09 AC 160 ms
8,144 KB
testcase_10 AC 157 ms
8,132 KB
testcase_11 AC 157 ms
8,276 KB
testcase_12 AC 156 ms
8,060 KB
testcase_13 AC 157 ms
8,068 KB
testcase_14 AC 157 ms
8,212 KB
testcase_15 AC 154 ms
8,124 KB
testcase_16 AC 163 ms
8,272 KB
testcase_17 AC 155 ms
8,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

v=list(map(int, input().split()))
m=30
INF=1000
ans=INF
import itertools
for a, b, c in itertools.combinations(range(1, m+1), 3):
    dp=[INF]*(m+1)
    dp[0]=0
    for i in range(1, m+1):
        for x in [a, b, c]:
            if i>=x:
                dp[i]=min(dp[i], dp[i-x]+1)
    ans=min(ans, sum(dp[x] for x in v))
print(ans)
0