結果

問題 No.1042 愚直大学
ユーザー nanophoto12
提出日時 2020-05-06 01:01:25
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 795 bytes
コンパイル時間 2,938 ms
コンパイル使用メモリ 192,392 KB
最終ジャッジ日時 2025-01-10 07:04:05
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define M_PI       3.14159265358979323846   // pi

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> VI;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> t3;
typedef tuple<ll, ll, ll, ll> t4;

#define rep(a,n) for(ll a = 0;a < n;a++)
#define repi(a,b,n) for(ll a = b;a < n;a++)

#include <bits/stdc++.h>
using namespace std;

const ll mod = 1e9 + 7;

const ll INF = 1e15;

int main() {
	ll p, q;
	cin >> p >> q;
	double left = 1;
	double right = pow(2, 60);
	for (int i = 0; i < 100; i++) {
		double n = left + right;
		n /= 2;
		double t1 = n * n;
		double t2 = p + q * n * log2(n);
		if (t1 <= t2) {
			left = n;
		}
		else {
			right = n;
		}
	}
	cout << std::fixed << std::setprecision(10) << left << endl;
	return 0;
}
0