結果

問題 No.555 世界史のレポート
ユーザー togetogehattogetogehat
提出日時 2018-08-19 23:28:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 956 ms / 2,000 ms
コード長 212 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 14,976 KB
最終ジャッジ日時 2024-05-01 17:01:59
合計ジャッジ時間 8,366 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,752 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 33 ms
10,752 KB
testcase_04 AC 35 ms
10,752 KB
testcase_05 AC 36 ms
10,880 KB
testcase_06 AC 37 ms
10,752 KB
testcase_07 AC 37 ms
10,752 KB
testcase_08 AC 39 ms
10,752 KB
testcase_09 AC 41 ms
10,624 KB
testcase_10 AC 657 ms
13,696 KB
testcase_11 AC 720 ms
14,080 KB
testcase_12 AC 614 ms
13,568 KB
testcase_13 AC 556 ms
13,312 KB
testcase_14 AC 689 ms
13,952 KB
testcase_15 AC 718 ms
13,952 KB
testcase_16 AC 600 ms
13,440 KB
testcase_17 AC 641 ms
13,824 KB
testcase_18 AC 741 ms
13,952 KB
testcase_19 AC 956 ms
14,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
c, v = map(int, input().split())
dp = [float('inf')]*(2*n+1)
dp[1] = 0
for i in range(1, n+1):
    for j in range(i+i, 2*n+1, i):
        dp[j] = min(dp[j], dp[i]+c+v*(j//i-1))
print(min(dp[n:]))
0