結果
| 問題 | No.555 世界史のレポート |
| コンテスト | |
| ユーザー |
nanophoto12
|
| 提出日時 | 2017-08-11 23:20:40 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,155 bytes |
| 記録 | |
| コンパイル時間 | 673 ms |
| コンパイル使用メモリ | 91,536 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-12 21:55:18 |
| 合計ジャッジ時間 | 1,359 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 WA * 14 |
ソースコード
#include <cmath>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <functional>
#include <queue>
#include <iostream>
#include <string.h>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <cstdint>
#include <climits>
#include <unordered_set>
#include <sstream>
#include <stack>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
int main()
{
int n;
cin >> n;
int c, v;
cin >> c >> v;
ll minCost = 1e13;
for(int i = 1;i < n;i++)
{
ll count = 1;
ll cost = 0;
ll b = 0;
for(int j = 0;j < i;j++)
{
b = count;
cost += c;
count += b;
cost += v;
if(count >= n)
{
break;
}
}
if(count < n)
{
ll aa = (n-count)/ b;
if((n - count) % b > 0)
{
aa++;
}
cost += aa * v;
}
//cout << i << "," << count << "," << cost << endl;
minCost = min(minCost, cost);
}
cout << minCost << endl;
return 0;
}
nanophoto12