結果

問題 No.456 Millions of Submits!
ユーザー pekempeypekempey
提出日時 2016-12-07 22:52:23
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 3,956 ms / 4,500 ms
コード長 837 bytes
コンパイル時間 1,444 ms
コンパイル使用メモリ 164,196 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-05 06:54:48
合計ジャッジ時間 13,786 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#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);
        if (b == 0) {
            printf("%.15f\n", pow(t, 1.0 / a));
            continue;
        }
        if (a == 0) {
            printf("%.15f\n", exp(pow(t, 1.0 / b)));
            continue;
        }
        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;
            }
        }
        printf("%.15f\n", ok);
    }
}
0