結果
問題 | No.555 世界史のレポート |
ユーザー |
|
提出日時 | 2017-09-08 17:52:15 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 51 ms / 2,000 ms |
コード長 | 436 bytes |
コンパイル時間 | 2,219 ms |
コンパイル使用メモリ | 193,072 KB |
最終ジャッジ日時 | 2025-01-05 02:45:06 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> using namespace std; const int MAXN = 50000; int N; int C, V; int dp[MAXN * 2]; int main() { ios::sync_with_stdio(false); cin >> N; cin >> C >> V; memset(dp, 0x3f, sizeof(dp)); dp[1] = 0; for (int i = 1; i < N; ++i) { for (int j = 2; j * i < N * 2; ++j) { dp[j * i] = min(dp[j * i], dp[i] + C + V * (j - 1)); } } cout << *min_element(dp + N, dp + N * 2) << endl; return 0; }