結果

問題 No.27 板の準備
ユーザー convexineqconvexineq
提出日時 2020-12-06 04:32:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 93 ms / 5,000 ms
コード長 308 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 81,612 KB
実行使用メモリ 75,924 KB
最終ジャッジ日時 2023-10-17 04:25:28
合計ジャッジ時間 2,987 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
75,924 KB
testcase_01 AC 78 ms
75,612 KB
testcase_02 AC 79 ms
75,612 KB
testcase_03 AC 78 ms
75,612 KB
testcase_04 AC 78 ms
75,612 KB
testcase_05 AC 79 ms
75,612 KB
testcase_06 AC 79 ms
75,612 KB
testcase_07 AC 78 ms
75,612 KB
testcase_08 AC 77 ms
75,612 KB
testcase_09 AC 77 ms
75,612 KB
testcase_10 AC 77 ms
75,612 KB
testcase_11 AC 77 ms
75,612 KB
testcase_12 AC 77 ms
75,612 KB
testcase_13 AC 77 ms
75,616 KB
testcase_14 AC 78 ms
75,612 KB
testcase_15 AC 77 ms
75,612 KB
testcase_16 AC 77 ms
75,612 KB
testcase_17 AC 77 ms
75,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

*v, = map(int,input().split())
INF = ans = 10**9
from itertools import product
for lst in product(range(1,31),repeat=3):
    dp = [INF]*31
    dp[0] = 0
    for i in lst:
        for r in range(i,31):
            dp[r] = min(dp[r], 1+dp[r-i])
    res = sum(dp[i] for i in v)
    ans = min(ans,res)
print(ans)
0