結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 15 ms
8,264 KB
testcase_02 AC 142 ms
8,256 KB
testcase_03 AC 16 ms
8,268 KB
testcase_04 AC 73 ms
8,068 KB
testcase_05 AC 44 ms
8,252 KB
testcase_06 AC 83 ms
8,088 KB
testcase_07 AC 144 ms
8,292 KB
testcase_08 AC 162 ms
8,088 KB
testcase_09 AC 139 ms
8,288 KB
testcase_10 AC 123 ms
8,072 KB
testcase_11 AC 57 ms
8,068 KB
testcase_12 AC 83 ms
8,072 KB
testcase_13 AC 73 ms
8,100 KB
testcase_14 AC 50 ms
8,076 KB
testcase_15 AC 123 ms
8,216 KB
testcase_16 AC 19 ms
8,212 KB
testcase_17 AC 158 ms
8,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

v=list(map(int, input().split()))
m=max(v)
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