結果

問題 No.555 世界史のレポート
ユーザー ayaoniayaoni
提出日時 2021-05-05 02:18:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 669 bytes
コンパイル時間 442 ms
コンパイル使用メモリ 86,776 KB
実行使用メモリ 77,304 KB
最終ジャッジ日時 2023-10-01 04:20:48
合計ジャッジ時間 3,510 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,096 KB
testcase_01 AC 76 ms
71,248 KB
testcase_02 AC 83 ms
71,116 KB
testcase_03 AC 80 ms
76,244 KB
testcase_04 AC 82 ms
76,340 KB
testcase_05 AC 84 ms
76,428 KB
testcase_06 AC 85 ms
76,168 KB
testcase_07 AC 84 ms
76,172 KB
testcase_08 AC 82 ms
76,388 KB
testcase_09 AC 83 ms
76,508 KB
testcase_10 AC 105 ms
77,076 KB
testcase_11 AC 104 ms
77,304 KB
testcase_12 AC 101 ms
76,964 KB
testcase_13 AC 99 ms
77,088 KB
testcase_14 AC 103 ms
77,044 KB
testcase_15 AC 103 ms
77,128 KB
testcase_16 AC 99 ms
77,192 KB
testcase_17 AC 100 ms
77,132 KB
testcase_18 AC 105 ms
77,012 KB
testcase_19 AC 111 ms
77,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


N = I()
C,V = MI()

inf = 10**18
dp = [inf]*(2*N+1)
dp[1] = 0
for i in range(1,N+1):
    for j in range(2*i,2*N+1,i):
        dp[j] = min(dp[j],dp[i]+C+V*(j//i-1))

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