結果

問題 No.456 Millions of Submits!
コンテスト
ユーザー りあん
提出日時 2016-12-07 22:13:49
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 937 ms / 4,500 ms
コード長 741 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 930 ms
コンパイル使用メモリ 183,596 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-03-07 16:24:49
合計ジャッジ時間 6,327 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

int main() {
    int m;
    scanf("%d", &m);
    double e = exp(1);
    double eps = 1e-10 * 2;
    while(m--) {
        int a, b;
        double t, l, r, n;
        scanf("%d%d%lf", &a, &b, &t);
        if (!b) {
            printf("%.12f\n", pow(t, 1.0 / a));
            continue;
        }
        if (!a) {
            printf("%.12f\n", exp(pow(t, 1.0 / b)));
            continue;
        }
        double tt = log(t);
        l = 0;
        r = 4;
        while (r - l > eps) {
            n = (l + r) / 2;
            if (a * n + b * log(n) > tt)
                r = n;
            else
                l = n;
        }
        printf("%.12f\n", exp((l + r) / 2));
    }
    return 0;
}
0