結果

問題 No.456 Millions of Submits!
ユーザー pekempeypekempey
提出日時 2016-12-07 22:29:00
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,345 bytes
コンパイル時間 3,097 ms
コンパイル使用メモリ 175,824 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-05 06:24:18
合計ジャッジ時間 9,615 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 3 ms
4,380 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 OLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
#include <bits/stdc++.h>
using namespace std;

int main() {
    int m;
    cin >> m;
    double maxi = exp(10);
    while (m--) {
        int a, b;
        double t;
        scanf("%d %d %lf", &a, &b, &t);
        double ans = 0;
        if (t < 1) {
            double ok = 1.1;
            double ng = 0;
            for (int ii = 0; ii < 35; ii++) {
                double mid = (ok + ng) / 2;
                if (pow(mid, a) * pow(log(mid), b) >= t) {
                    ok = mid;
                } else {
                    ng = mid;
                }
            }
            if (ok < 1 + 1e-6) {
                ans = ok;
                printf("%.20f\n", ans);
                continue;
            }
        }
        {
            double ok = maxi;
            double ng = 1;
            double logT = log(t);
            for (int ii = 0; ii < 44; ii++) {
                double mid = (ok + ng) / 2;
                double logN = log(mid);
                double loglogN = log(logN);
                if (a * logN + b * loglogN >= logT) {
                    ok = mid;
                } else {
                    ng = mid;
                }
            }
            if (ok > 1 + 1e-9) {
                ans = ok;
            }
        }
        printf("%.20f\n", ans);
    }
}
0