結果

問題 No.555 世界史のレポート
ユーザー sora410_t
提出日時 2017-11-03 11:02:24
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 308 bytes
コンパイル時間 587 ms
コンパイル使用メモリ 66,064 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-22 15:19:38
合計ジャッジ時間 4,149 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main() {
	int n, c, v;
	cin >> n;
	cin >> c >> v;
	vector<int> dp {-1, -1, c+v, c+v+v};

	if (n != 2 || n != 3) {
		for (int i = 4; i <= n; ++i) {
			dp[i] = min(dp[ceil(i/2.0)]+c+v, c+(i-1)*v);
		}
	}
	cout << dp[n] << endl;
}
0