結果

問題 No.555 世界史のレポート
ユーザー convexineqconvexineq
提出日時 2021-02-25 05:10:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 228 bytes
コンパイル時間 1,360 ms
コンパイル使用メモリ 81,308 KB
実行使用メモリ 64,544 KB
最終ジャッジ日時 2023-10-25 09:48:19
合計ジャッジ時間 2,690 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,356 KB
testcase_01 AC 37 ms
53,356 KB
testcase_02 AC 37 ms
53,356 KB
testcase_03 AC 44 ms
59,392 KB
testcase_04 AC 43 ms
59,396 KB
testcase_05 AC 44 ms
59,396 KB
testcase_06 AC 47 ms
59,884 KB
testcase_07 AC 45 ms
59,884 KB
testcase_08 AC 45 ms
59,884 KB
testcase_09 AC 45 ms
59,884 KB
testcase_10 AC 54 ms
64,428 KB
testcase_11 AC 54 ms
64,460 KB
testcase_12 AC 54 ms
64,428 KB
testcase_13 AC 53 ms
64,396 KB
testcase_14 AC 53 ms
64,452 KB
testcase_15 AC 55 ms
64,456 KB
testcase_16 AC 54 ms
64,416 KB
testcase_17 AC 54 ms
64,440 KB
testcase_18 AC 54 ms
64,464 KB
testcase_19 AC 56 ms
64,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,c,v = map(int,open(0).read().split())
ans = INF = 1<<60
dp = [INF]*(n)
dp[1] = 0
for i in range(1,n):
    r = dp[i] + c
    for j in range(i+i,n,i):
        r += v
        dp[j] = min(dp[j],r)
    ans = min(ans,r+v)
print(ans)
0