結果

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
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(ng - ok > 1e-7) {
    long double n = (ok + ng) / 2.0;
    //cout << n << " " << p + q * log2(n) << endl;
    if (n * n <= p + q * n * log2(n)) ok = n;
    else ng = n;
  }

  cout<<ok<<endl;
}
0