結果
問題 |
No.555 世界史のレポート
|
ユーザー |
![]() |
提出日時 | 2017-08-11 23:37:42 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,519 bytes |
コンパイル時間 | 786 ms |
コンパイル使用メモリ | 101,408 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-12 22:05:22 |
合計ジャッジ時間 | 1,930 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 WA * 7 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <algorithm> #include <utility> #include <functional> #include <cstring> #include <queue> #include <stack> #include <math.h> #include <iterator> #include <vector> #include <string> #include <set> #include <math.h> #include <iostream> #include <random> #include<map> #include <iomanip> #include <time.h> #include <stdlib.h> #include <list> #include <typeinfo> #include <list> #include <set> #include <cassert> #include<fstream> #include <unordered_map> using namespace std; #define eps 0.00000001 #define LONG_INF 10000000000000000 #define GOLD 1.61803398874989484820458 #define MAX_MOD 1000000007 #define REP(i,n) for(long long i = 0;i < n;++i) long long n, c, v; long long judge(long long sep,long long maxium) { long long now = 1; long long board = 1; int j = 0; for (j = 0;now < n;++j) { now += board; if ((j + 1) % sep == 0 && (j + 1) / sep <= maxium) { board = now; } } return j; } int main() { cin >> n >> c >> v; long long ans = 10000000000; for (int copy = 0;copy < n&© < 20;++copy) { long long bot = 1, top = n; while (top - bot > 2) { long long left = (bot + bot + top) / 3; long long right = (bot + top + top) / 3; if (judge(left, copy) <= judge(right, copy)) { top = right; } else { bot = left; } } long long hoge = judge(bot, copy); for (int i = bot + 1;i <= top;++i) { hoge = min(hoge, judge(i, copy)); } ans = min(ans, hoge*v + c*copy); } cout << ans+c << endl; return 0; }