結果

問題 No.1042 愚直大学
ユーザー hasegawa1hasegawa1
提出日時 2020-05-01 21:33:55
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 532 bytes
コンパイル時間 779 ms
コンパイル使用メモリ 82,064 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 22:27:38
合計ジャッジ時間 1,827 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <queue>
#include <tuple>
#include <set>
#include <map>

using namespace std;

int main(void) {
    double P, Q;
    cin >> P >> Q;

    double low = 1.0, high = 1e12;
    for(int i=0; i<100; i++) {
        double mid = (low + high) * 0.5;
        if(mid*mid < P + Q * mid * log2(mid)) {
            low = mid;
        } else {
            high = mid;
        }
    }

    printf("%lf\n", low);
    return 0;
}
0