結果

問題 No.456 Millions of Submits!
ユーザー ytftytft
提出日時 2021-04-01 20:46:37
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 722 bytes
コンパイル時間 1,759 ms
コンパイル使用メモリ 165,312 KB
実行使用メモリ 8,328 KB
最終ジャッジ日時 2023-08-23 04:24:30
合計ジャッジ時間 11,546 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 27 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 3 ms
4,376 KB
testcase_06 AC 3 ms
4,380 KB
testcase_07 AC 10 ms
4,380 KB
testcase_08 AC 10 ms
4,376 KB
testcase_09 AC 81 ms
4,380 KB
testcase_10 AC 80 ms
4,376 KB
testcase_11 AC 795 ms
4,376 KB
testcase_12 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:31:15: 警告: ‘middle’ may be used uninitialized [-Wmaybe-uninitialized]
   31 |         printf("%.12f",middle);
      |         ~~~~~~^~~~~~~~~~~~~~~~
main.cpp:8:24: 備考: ‘middle’ はここで定義されています
    8 |     double upper,lower,middle;
      |                        ^~~~~~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
    int m;
    cin>>m;
    double a,b,t;
    double ipsilon=pow(10,-10);
    double upper,lower,middle;
    for(int i=0;i<m;i++){
        cin>>a>>b>>t;
        if(b==0){
            lower=0.1;
        }else{
            lower=1;
        }
        if(a==0){
            upper=pow(3,10);
            t=pow(t,1.0/b);
            b=1;
        }else{
            upper=10;
        }
        while(upper-lower>ipsilon){
            middle=(upper+lower)/2;
            if(pow(middle,a)*pow(log(middle),b)<t){
                lower=middle;
            }else{
                upper=middle;
            }
        }
        printf("%.12f",middle);
        cout<<endl;
    }
}
0