結果
| 問題 | No.555 世界史のレポート |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-08 17:52:15 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 436 bytes |
| 記録 | |
| コンパイル時間 | 1,328 ms |
| コンパイル使用メモリ | 210,128 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-06 18:12:17 |
| 合計ジャッジ時間 | 2,246 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}