結果
| 問題 |
No.1042 愚直大学
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-29 10:45:38 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 677 bytes |
| コンパイル時間 | 1,616 ms |
| コンパイル使用メモリ | 167,356 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-14 05:26:17 |
| 合計ジャッジ時間 | 2,594 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
#define ld long double
#define INF 1000000000000000000
typedef pair<ll, ll> pll;
typedef pair<int, int> pint;
ld P, Q;
bool isOK(ld key) { return P + Q * key * log2(key) >= key * key; }
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
cin >> P >> Q;
ld ok = 0.0, ng = 1000000000000000.0;
while (abs(ok - ng) > 1e-8) {
ld mid = (ok + ng) / 2;
if (isOK(mid))
ok = mid;
else
ng = mid;
}
cout << fixed << setprecision(10) << ok << endl;
}