結果

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

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;
using ll = long long int;
using lc = complex<double>;

int main(void) {
    constexpr ll MOD = 1e9 + 7;
    constexpr double PI = acos(-1);
    cout << fixed << setprecision(32);
    cin.tie(0); ios::sync_with_stdio(false);

    double p, q;
    cin >> p >> q;
    double ok = 1, ng = 1e9;
    for(ll i=0; i<10000; i++) {
        double mid = (ok + ng) / 2;
        (mid * mid < p + q * mid * logl(mid) / logl(2) ? ok : ng) = mid;
    }
    cout << ok << endl;
}
0