結果

問題 No.456 Millions of Submits!
ユーザー 紙ぺーぱー紙ぺーぱー
提出日時 2016-12-08 02:03:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 4,306 ms / 4,500 ms
コード長 613 bytes
コンパイル時間 1,495 ms
コンパイル使用メモリ 164,016 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-28 07:39:00
合計ジャッジ時間 15,225 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
double pp(double x,int k){
    double ret = 1.0;
    while (k)
    {
        if ((k & 1) == 1) ret *= x;
        x *= x;
        k >>= 1;
    }
    return ret;
}

int main(){
    int n,a,b;
    double t;
    scanf("%d\n",&n);
    for(int i=0;i<n;i++){
        scanf("%d%d%lf\n",&a,&b,&t);
        double l=0.0,r=0.0;
        if(a==0)r=pow(exp(10),1+1.0/b);
        else r=pow(10,1+1.0/a);
        for(int k=0;k<80;k++){
            double x=(l+r)/2;
            double u=pp(x,a)*pp(log(x),b);
            if(u<=t)l=x;
            else r=x;
        }
        printf("%.10lf\n",r);
    }
}
0