結果

問題 No.1042 愚直大学
ユーザー trineutrontrineutron
提出日時 2020-05-01 21:30:48
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 375 bytes
コンパイル時間 2,093 ms
コンパイル使用メモリ 193,844 KB
最終ジャッジ日時 2025-01-10 04:13:53
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    int p, q;
    cin >> p >> q;
    cout << setprecision(17);
    double l = 1, r = 1e19;
    while (r / l > 1.00000001) {
        double n = sqrt(r * l);
        if (n * n > p + q * n * log(n) / log(2.0)) {
            r = n;
        } else {
            l = n;
        }
    }
    cout << sqrt(r * l) << endl;
}
0