結果
| 問題 | No.1042 愚直大学 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-05-01 21:46:26 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 528 bytes | 
| コンパイル時間 | 1,740 ms | 
| コンパイル使用メモリ | 167,260 KB | 
| 実行使用メモリ | 13,768 KB | 
| 最終ジャッジ日時 | 2024-12-25 03:01:19 | 
| 合計ジャッジ時間 | 17,541 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 18 TLE * 5 | 
ソースコード
#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-6){
		double mid = (r+l)/2;
		if(isOK(mid)) l = mid;
		else r = mid; 
	}
	printf("%.12lf\n", l);
	return 0;
}
            
            
            
        