結果
| 問題 | No.456 Millions of Submits! |
| コンテスト | |
| ユーザー |
tubo28
|
| 提出日時 | 2016-12-08 01:59:07 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,015 bytes |
| 記録 | |
| コンパイル時間 | 778 ms |
| コンパイル使用メモリ | 76,180 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-23 06:27:50 |
| 合計ジャッジ時間 | 8,112 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 TLE * 1 |
ソースコード
//#define NDEBUG
#include <algorithm>
#include <cassert>
#include <ctime>
#include <iostream>
#include <string>
#include <tuple>
#include <vector>
#include <cmath>
#define dump(x) std::cerr << __LINE__ << ":\t" #x " = " << x << std::endl
using namespace std;
double f(int a, int b, double n) {
return pow(n, a) * pow(log(n), b);
}
double solve(double a, double b, double t) {
if (b == 0) {
return pow(t, 1.0 / a);
} else if (a == 0) {
return exp(pow(t, 1.0 / b));
} else {
double lo = 1.0, hi = 6.0;
for (int i = 0; i < 64; ++i) {
double mid = (lo + hi) / 2;
if (f(a, b, mid) > t) {
hi = mid;
} else {
lo = mid;
}
}
return lo;
}
}
int main() {
cin.tie(0);
ios::sync_with_stdio(0);
int m;
cin >> m;
for (int i = 0; i < m; i++) {
int a, b;
double t;
cin >> a >> b >> t;
printf("%.10f\n", solve(a, b, t));
}
}
tubo28