結果
問題 |
No.456 Millions of Submits!
|
ユーザー |
![]() |
提出日時 | 2017-02-21 21:45:42 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 674 bytes |
コンパイル時間 | 565 ms |
コンパイル使用メモリ | 68,668 KB |
実行使用メモリ | 10,528 KB |
最終ジャッジ日時 | 2024-06-23 18:26:12 |
合計ジャッジ時間 | 9,495 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 TLE * 1 |
ソースコード
#include <iostream> #include <cmath> #include <cstdio> using namespace std; int a, b; double t; double f(double x) { return pow(x, a) * pow(log(x), b) - t; } double fn(double x) { return a * pow(x, a - 1) * pow(log(x), b) + b * pow(x, a - 1) * pow(log(x), b - 1); } int main() { int T; scanf("%d", &T); while(T--) { scanf("%d %d %lf", &a, &b, &t); if(a == 0) { printf("%.11f\n", exp(pow(t, 1.0 / b))); }else if(b == 0) { printf("%.11f\n", pow(t, 1.0 / a)); }else{ double x = 2; // 初期値 for(int i = 0; i < 50; i++) { double nx = x - f(x) / fn(x); x = nx; } printf("%.11f\n", x); } } }