結果

問題 No.456 Millions of Submits!
ユーザー ei1333333ei1333333
提出日時 2016-12-09 00:16:30
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2,976 ms / 4,500 ms
コード長 597 bytes
コンパイル時間 1,235 ms
コンパイル使用メモリ 143,984 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-05 21:19:54
合計ジャッジ時間 11,164 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main()
{
  int M;
  scanf("%d", &M);
  while(M--) {
    int A, B;
    double T;
    scanf("%d %d %lf", &A, &B, &T);
    if(A == 0) {
      printf("%.12lf\n", exp(pow(T, 1.0 / B)));
    } else if(B == 0) {
      printf("%.12f\n", pow(T, 1.0 / A));
    } else {
      double low = 1, high = 10;
      T = log(T);
      for(int i = 0; i < 35; i++) {
        double mid = (low + high) * 0.5;
        double lgg = log(mid);
        if(A * lgg + B * log(lgg) >= T) high = mid;
        else low = mid;
      }
      printf("%.12lf\n", low);
    }
  }
}
0