結果
問題 |
No.555 世界史のレポート
|
ユーザー |
|
提出日時 | 2017-08-20 17:12:37 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,013 bytes |
コンパイル時間 | 837 ms |
コンパイル使用メモリ | 100,164 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-14 17:30:56 |
合計ジャッジ時間 | 1,439 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#define _USE_MATH_DEFINES #include <cstdio> #include <iostream> #include <sstream> #include <fstream> #include <iomanip> #include <algorithm> #include <cmath> #include <complex> #include <string> #include <vector> #include <list> #include <queue> #include <stack> #include <set> #include <map> #include <bitset> #include <numeric> #include <limits> #include <climits> #include <cfloat> #include <functional> #include <iterator> using namespace std; int main() { int n, c, v; cin >> n >> c >> v; int ans = INT_MAX; for(int i=1; ; ++i){ int x = 1; for(int j=0; j<i; ++j) x *= 2; int cost = (c + v) * i; if(x >= n){ ans = min(ans, cost); break; } for(int j=0; ; ++j){ x /= 2 + j / i; x *= 3 + j / i; cost += v; if(x >= n){ ans = min(ans, cost); break; } } } cout << ans << endl; return 0; }