結果

問題 No.555 世界史のレポート
ユーザー tktk_snsntktk_snsn
提出日時 2021-01-05 08:57:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 356 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 82,320 KB
実行使用メモリ 65,268 KB
最終ジャッジ日時 2024-04-23 15:27:26
合計ジャッジ時間 1,938 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
52,616 KB
testcase_01 AC 42 ms
52,944 KB
testcase_02 AC 39 ms
52,920 KB
testcase_03 AC 45 ms
59,108 KB
testcase_04 AC 44 ms
59,196 KB
testcase_05 AC 46 ms
60,364 KB
testcase_06 AC 46 ms
59,860 KB
testcase_07 AC 45 ms
60,232 KB
testcase_08 AC 46 ms
61,804 KB
testcase_09 AC 51 ms
60,856 KB
testcase_10 AC 56 ms
64,124 KB
testcase_11 AC 55 ms
65,268 KB
testcase_12 AC 55 ms
63,788 KB
testcase_13 AC 56 ms
63,352 KB
testcase_14 AC 56 ms
63,656 KB
testcase_15 AC 56 ms
64,052 KB
testcase_16 AC 56 ms
64,644 KB
testcase_17 AC 58 ms
63,744 KB
testcase_18 AC 56 ms
63,336 KB
testcase_19 AC 57 ms
64,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
C, V = map(int, input().split())
inf = 10**18
dp = [inf] * (2 * N + 1)
dp[1] = 0

for i in range(1, N):
    x = i + i
    cost = C + V
    while True:
        dp[x] = min(dp[x], dp[i] + cost)
        if x > N:
            break
        x += i
        cost += V

ans = inf
for i in range(N, 2 * N + 1):
    ans = min(ans, dp[i])

print(ans)
0