結果
問題 | No.1042 愚直大学 |
ユーザー | Haa |
提出日時 | 2020-05-01 21:38:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 543 bytes |
コンパイル時間 | 1,944 ms |
コンパイル使用メモリ | 165,468 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-25 00:40:30 |
合計ジャッジ時間 | 2,969 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> P; typedef vector<ll> VI; typedef vector<VI> VVI; const ll MOD = 1000000007; const ll INF = 2147483647; const ll LINF = 9223372036854775807; #define REP(i, n) for (int i = 0; i < n; i++) #define ALL(v) v.begin(), v.end() int main() { ll p, q; cin >> p >> q; long double ok=1, ng=LINF; while(ng-ok>0.00000001){ long double s=ok+(ng-ok)/2; if(s*s<p+q*s*log2(s)) ok=s; else ng=s; } cout << setprecision(10) << ok << endl; return 0; }