結果

問題 No.456 Millions of Submits!
コンテスト
ユーザー WutongDeath
提出日時 2026-11-23 04:35:14
言語 C++23(gcc16)
(gcc 16.2.0 + boost 1.92.0 + ACL)
コンパイル:
g++-16 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc16.so -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1,288 ms / 4,500 ms
+ 953µs
コード長 661 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,229 ms
コンパイル使用メモリ 180,192 KB
実行使用メモリ 9,900 KB
最終ジャッジ日時 2026-11-23 04:35:22
合計ジャッジ時間 6,535 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge6_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

int m;
double ans;

double Calc(int a, int b, double t) {
    if (b == 0) return pow(t, 1.0 / a);
    if (a == 0) return exp(pow(t, 1.0 / b));

    double l = 0, r = log(10.0), tgt = log(t);
    for (int i = 1; i <= 45; ++i) {
        double mid = (l + r) / 2;
        if (a * mid + b * log(mid) < tgt) l = mid;
        else r = mid;
    }
    return exp((l + r) / 2);
}

int main() {
    scanf("%d", &m);

    while (m--) {
        int a, b;
        double t;
        scanf("%d%d%lf", &a, &b, &t);
        ans = Calc(a, b, t);
        printf("%.12f\n", ans);
    }

    return 0;
}
0