結果
| 問題 |
No.555 世界史のレポート
|
| ユーザー |
Kutimoti_T
|
| 提出日時 | 2018-06-28 22:23:32 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 454 bytes |
| コンパイル時間 | 1,665 ms |
| コンパイル使用メモリ | 158,984 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-30 23:34:41 |
| 合計ジャッジ時間 | 2,180 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)
int N,C,V;
vector<int> dp(101010,1e9);
int main(){
dp[1] = 0;
cin >> N >> C >> V;
rep(i,1,N - 1){
for(int j = 1;i + i * j <= 101010 - 1;j++){
dp[i + i * j] = min(dp[i + i * j] , dp[i] + C + V * j);
}
}
int ans = dp[N];
rep(i,N,101010 - 1){
ans = min(ans , dp[i]);
}
cout << ans << endl;
}
Kutimoti_T