結果

問題 No.456 Millions of Submits!
ユーザー koba-e964koba-e964
提出日時 2016-12-08 00:12:02
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 628 bytes
コンパイル時間 633 ms
コンパイル使用メモリ 63,536 KB
実行使用メモリ 8,056 KB
最終ジャッジ日時 2023-09-05 08:38:57
合計ジャッジ時間 9,655 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <algorithm>
#include <cmath>
#include <iostream>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)

using namespace std;

double solve(int a, int b, double t) {
  if (b == 0) {
    return pow(t, 1.0 / a);
  }
  if (a == 0) {
    return exp(pow(t, 1.0 / b));
  }
  double lo = 0, hi = 10;
  REP(loop_cnt, 0, 36) {
    double mid = (lo + hi) / 2;
    if (pow(mid, a) * pow(log(mid), b) <= t) {
      lo = mid;
    } else {
      hi = mid;
    }
  }
  return lo;
}

int main(void){
  int m;
  cin >> m;
  REP(i, 0, m) {
    int a, b;
    double t;
    cin >> a >> b >> t;
    printf("%.15f\n", solve(a, b, t));
  }
}
0