結果

問題 No.555 世界史のレポート
ユーザー togetogehattogetogehat
提出日時 2018-08-19 23:26:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 215 bytes
コンパイル時間 133 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 14,848 KB
最終ジャッジ日時 2024-05-01 16:57:33
合計ジャッジ時間 7,742 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
10,880 KB
testcase_01 AC 32 ms
10,752 KB
testcase_02 AC 33 ms
10,752 KB
testcase_03 AC 36 ms
10,880 KB
testcase_04 AC 33 ms
10,752 KB
testcase_05 AC 34 ms
10,752 KB
testcase_06 AC 36 ms
10,880 KB
testcase_07 AC 37 ms
10,880 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 594 ms
13,696 KB
testcase_11 AC 659 ms
14,080 KB
testcase_12 AC 580 ms
13,696 KB
testcase_13 AC 529 ms
13,312 KB
testcase_14 AC 644 ms
13,952 KB
testcase_15 AC 668 ms
14,080 KB
testcase_16 AC 551 ms
13,696 KB
testcase_17 AC 615 ms
13,824 KB
testcase_18 AC 665 ms
14,080 KB
testcase_19 AC 876 ms
14,848 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//2+2):
    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