結果
| 問題 |
No.1042 愚直大学
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-01 21:44:11 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 528 bytes |
| コンパイル時間 | 1,872 ms |
| コンパイル使用メモリ | 165,376 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-12-25 02:48:41 |
| 合計ジャッジ時間 | 26,378 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 TLE * 8 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
double p, q;
bool isOK(double n){
return n*n < p+q*n*log2(n);
}
signed main(){
cin >> p >> q;
double l, r;
l = 0;
r = 1;
while(isOK(r)) r *= 2;
while(r-l >= 1e-8){
double mid = (r+l)/2;
if(isOK(mid)) l = mid;
else r = mid;
}
printf("%.12lf\n", l);
return 0;
}