結果
| 問題 | No.456 Millions of Submits! |
| コンテスト | |
| ユーザー |
tubo28
|
| 提出日時 | 2016-12-08 02:20:29 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,154 bytes |
| 記録 | |
| コンパイル時間 | 754 ms |
| コンパイル使用メモリ | 76,188 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-23 06:44:49 |
| 合計ジャッジ時間 | 7,515 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 12 |
ソースコード
#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 mypow(double x, int y) {
double res = 1;
while (y) {
res *= res;
if (y & 1) res *= x;
y /= 2;
}
return res;
}
double f(int a, int b, double n) {
return mypow(n, a) * mypow(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 < 60; ++i) {
double mid = (lo + hi) / 2;
if (f(a, b, mid) > t) {
hi = mid;
} else {
lo = mid;
}
}
return lo;
}
}
int main() {
int m;
cin >> m;
cout << fixed;
cout.precision(10);
for (int i = 0; i < m; i++) {
int a, b;
double t;
cin >> a >> b >> t;
cout << solve(a, b, t) << '\n';
}
}
tubo28