結果

問題 No.456 Millions of Submits!
ユーザー pekempeypekempey
提出日時 2016-12-07 22:24:16
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 1,442 bytes
コンパイル時間 2,324 ms
コンパイル使用メモリ 165,744 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-09-05 06:21:38
合計ジャッジ時間 12,280 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 2 ms
4,376 KB
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 AC 3 ms
4,376 KB
testcase_07 AC 11 ms
4,380 KB
testcase_08 AC 12 ms
4,380 KB
testcase_09 AC 98 ms
4,376 KB
testcase_10 AC 99 ms
4,384 KB
testcase_11 AC 968 ms
4,380 KB
testcase_12 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#define getchar getchar_unlocked

int in() {
    int n, c;
    while ((c = getchar()) < '0') if (c == EOF) abort();
    n = c - '0';
    while ((c = getchar()) >= '0') n = n * 10 + c - '0';
    return n;
}

int main() {
    int m;
    cin >> m;
    double maxi = exp(10);
    while (m--) {
        int a = in(), b = in();
        int A = in(), B = in();
        double t = A + 1e-4 * B;
        double ans = 0;
        {
            double ok = 1.1;
            double ng = 0;
            for (int ii = 0; ii < 40; 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;
            }
        }
        {
            double ok = maxi;
            double ng = 1;
            double logT = log(t);
            for (int ii = 0; ii < 50; 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