結果

問題 No.555 世界史のレポート
ユーザー Lapinpon
提出日時 2017-08-12 01:04:12
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 511 ms
コンパイル使用メモリ 54,492 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-12 22:44:20
合計ジャッジ時間 1,502 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
	int n,c,v,cost[50001]={0,0};
	cin>>n>>c>>v;
	for(int i=2;i<=n;i++) cost[i]=1145141919;
	for(int i=1;i<=n;i++) for(int j=1;;j++){
			int now=min(n,i+j*i);
			cost[now]=min(cost[now],cost[i]+c+j*v);
			if(i+j*i>n) break;
	}
	cout<<cost[n]<<endl;
	return 0;
}		
0