結果

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

ソースコード

diff #

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPLL(i, n) for (ll i = 0; i < (ll)(n); i++)
using namespace std;
template<class T>inline bool chmax(T &a, const T &b){if(a < b){a = b; return 1;}return 0;}
template<class T>inline bool chmin(T &a, const T &b){if(a > b){a = b; return 1;}return 0;}
typedef long long ll;

// yukicoder No.1042 愚直大学
// 2020.06.13



int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  double P, Q; cin >> P >> Q;
  double leftOK = 1.0;
  double rightNG = 1e12;
  REP(i, 100){
    double mid = (leftOK+rightNG)/2;
    if(mid*mid <= P+Q*mid*log2(mid)){
      leftOK = mid;
    }else{
      rightNG = mid;
    }
  }
  cout << fixed << setprecision(10) << leftOK << endl;
}
0