結果

問題 No.27 板の準備
ユーザー 👑 rin204rin204
提出日時 2022-07-04 16:19:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 425 bytes
コンパイル時間 1,666 ms
コンパイル使用メモリ 86,608 KB
実行使用メモリ 77,676 KB
最終ジャッジ日時 2023-08-21 00:03:16
合計ジャッジ時間 4,429 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
77,252 KB
testcase_01 AC 117 ms
77,368 KB
testcase_02 AC 118 ms
77,512 KB
testcase_03 AC 118 ms
77,592 KB
testcase_04 AC 118 ms
77,392 KB
testcase_05 AC 119 ms
77,516 KB
testcase_06 AC 117 ms
77,608 KB
testcase_07 AC 118 ms
77,408 KB
testcase_08 AC 118 ms
77,380 KB
testcase_09 AC 118 ms
77,548 KB
testcase_10 AC 119 ms
77,548 KB
testcase_11 AC 116 ms
77,372 KB
testcase_12 AC 118 ms
77,676 KB
testcase_13 AC 117 ms
77,408 KB
testcase_14 AC 119 ms
77,240 KB
testcase_15 AC 119 ms
77,416 KB
testcase_16 AC 118 ms
77,504 KB
testcase_17 AC 123 ms
77,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

V = list(map(int, input().split()))
ans = 1 << 30
for a in range(1, 31):
    for b in range(1, 31):
        for c in range(1, 31):
            dp = [1 << 30] * 31
            dp[0] = 0
            for x in [a, b, c]:
                for i in range(x, 31):
                    dp[i] = min(dp[i], dp[i - x] + 1)
            tot = 0
            for v in V:
                tot += dp[v]
            ans = min(ans, tot)
print(ans)
0