結果

問題 No.1042 愚直大学
ユーザー Y17
提出日時 2020-05-01 21:53:11
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 507 bytes
コンパイル時間 1,849 ms
コンパイル使用メモリ 165,292 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-12-25 03:45:54
合計ジャッジ時間 17,894 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18 TLE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#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 = 1;
	r = 1e18;

	while(r-l >= 1e-6){
		double mid = (r+l)/2;
		if(isOK(mid)) l = mid;
		else r = mid; 
	}

	printf("%.12lf\n", l);

	return 0;
}
0