結果

問題 No.1042 愚直大学
ユーザー queee
提出日時 2020-05-01 21:49:12
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 549 bytes
コンパイル時間 759 ms
コンパイル使用メモリ 82,408 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-25 03:16:58
合計ジャッジ時間 1,664 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <iomanip>

using namespace std; using ll=long long; const int INF=1e9;
typedef pair<int,int> P;

int main() {
  long double p,q; cin>>p>>q;
  long double ok=0, ng=2e9;

  while(true) {
    long double n = (ok + ng) / 2.0;
    long double s = ng - ok;
    if (abs(s) < n / 1e7) break;
    //cout << n << " " << p + q * log2(n) << endl;
    if (n * n <= p + q * n * log2(n)) ok = n;
    else ng = n;
  }

  cout<<fixed<<setprecision(20)<<ok<<endl;
}
0