結果

問題 No.456 Millions of Submits!
ユーザー imulan
提出日時 2016-12-08 01:35:16
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3,215 ms / 4,500 ms
コード長 935 bytes
コンパイル時間 1,644 ms
コンパイル使用メモリ 165,828 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-23 06:10:59
合計ジャッジ時間 11,632 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

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

typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second

inline double f(double x, int a, int b)
{
    return pow(x,a)*pow(log(x),b);
}

int main()
{
    int m;
    scanf(" %d", &m);
    while(m--)
    {
        int a,b;
        double t;
        scanf(" %d %d %lf", &a, &b, &t);

        double ans;
        if(a==0) ans = pow(exp(1), pow(t,1.0/b));
        else if(b==0) ans = pow(t,1.0/a);
        else
        {
            double l=1, r=10;
            while(r-l>1e-9)
            {
                double mid=(l+r)/2;
                if(f(mid,a,b)<t) l=mid;
                else r=mid;
            }
            ans = (l+r)/2;
        }

        printf("%.12f\n", ans);
    }
    return 0;
}
0