結果

問題 No.555 世界史のレポート
コンテスト
ユーザー gzlcp
提出日時 2017-08-11 23:19:18
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 263 ms / 2,000 ms
コード長 744 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 847 ms
コンパイル使用メモリ 106,260 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-30 01:48:49
合計ジャッジ時間 3,136 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<iostream>
#include<iomanip>
#include<math.h>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<string>
#include<complex>

#define INF (long long)1000000000
#define MOD 1000000007
#define EPS 1e-8

#define REP(i, m) for(long long i = 0; i < m; ++i)
#define FOR(i, n, m) for(long long i = n; i < m; ++i)
#define ALL(v) v.begin(), v.end()
#define pb push_back

using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef long double ld;

int n,c,v;

ll rec(ll dig, ll cl) {
	if(dig>=n) return 0;
	else {
		if(dig==cl) return (rec(dig+cl,cl)+v);
		else {
			return min(rec(dig+cl,cl)+v,rec(dig,dig)+c);
		}
	}
}

int main() {
	cin>>n>>c>>v;
	cout<<c+rec(1,1)<<endl;
}
0