結果
問題 | No.555 世界史のレポート |
ユーザー |
![]() |
提出日時 | 2021-01-05 08:57:31 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 63 ms / 2,000 ms |
コード長 | 356 bytes |
コンパイル時間 | 200 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 62,848 KB |
最終ジャッジ日時 | 2024-10-15 15:50:21 |
合計ジャッジ時間 | 1,923 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
N = int(input())C, V = map(int, input().split())inf = 10**18dp = [inf] * (2 * N + 1)dp[1] = 0for i in range(1, N):x = i + icost = C + Vwhile True:dp[x] = min(dp[x], dp[i] + cost)if x > N:breakx += icost += Vans = inffor i in range(N, 2 * N + 1):ans = min(ans, dp[i])print(ans)