結果
| 問題 | No.555 世界史のレポート |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-20 09:33:29 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 422 bytes |
| 記録 | |
| コンパイル時間 | 1,257 ms |
| コンパイル使用メモリ | 211,540 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-06-10 21:43:48 |
| 合計ジャッジ時間 | 2,386 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using lint=long long;
const long long INF=1LL<<61;
int main(){
int n,c,v; scanf("%d%d%d",&n,&c,&v);
vector<lint> dp(2*n+1,INF);
dp[1]=0;
for(int i=1;i<=2*n;i++){
lint cost=c;
for(int j=2*i;j<=2*n;j+=i){
cost+=v;
dp[j]=min(dp[j],dp[i]+cost);
}
}
printf("%lld\n",*min_element(dp.begin()+n,dp.end()));
return 0;
}