結果

問題 No.456 Millions of Submits!
ユーザー yosupotyosupot
提出日時 2016-12-07 22:31:27
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,122 bytes
コンパイル時間 1,958 ms
コンパイル使用メモリ 93,804 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-05 06:25:35
合計ジャッジ時間 11,303 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <algorithm>
#include <numeric>
#include <random>
#include <vector>
#include <array>
#include <bitset>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>

using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr ll TEN(int n) { return (n==0) ? 1 : 10*TEN(n-1); }
int bsr(int x) { return 31 - __builtin_clz(x); }

const double E = exp(double(1));

double calc(int a, int b, double t) {
    if (a == 0) {
        return pow(E, pow(t, 1.0/b));
    }
    if (b == 0) {
        return pow(t, 1.0/a);
    }
    double x = 2;
    for (int j = 0; j < 40; j++) {
        double u = pow(x, a) * pow(log(x), b);
        double y = u - t;
        double dx = u / x / log(x) * (a+b);
        x -= y/dx;
    }
    return x;
}

int main() {
    int m;
    scanf("%d", &m);
    for (int i = 0; i < m; i++) {
        int a, b; double t;
        scanf("%d %d %lf", &a, &b, &t);

        printf("%.20lf\n", calc(a, b, t));
    }
    return 0;
}
0