結果
問題 |
No.456 Millions of Submits!
|
ユーザー |
![]() |
提出日時 | 2016-12-07 21:50:46 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 650 bytes |
コンパイル時間 | 1,411 ms |
コンパイル使用メモリ | 158,560 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-23 02:22:36 |
合計ジャッジ時間 | 5,594 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 13 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:6:17: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | int m; scanf("%d", &m); | ~~~~~^~~~~~~~~~ main.cpp:8:34: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | int a, b; double t; scanf("%d%d%lf", &a, &b, &t); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(long long i = 0; i < (long long)(n); i++) int main() { int m; scanf("%d", &m); while(m--) { int a, b; double t; scanf("%d%d%lf", &a, &b, &t); if (!b) { printf("%.12f\n", pow(t, 1.0 / a)); continue; } if (!a) { printf("%.12f\n", exp(pow(t, 1.0 / b))); continue; } double l = 0, r = t, n; double tmp = 1; while (r - l > 4e-10) { n = (l + r) / 2; rep(_, a) tmp *= n; rep(_, b) tmp *= log(n); (tmp > t) ? r = n : l = n; } printf("%.12f\n", n); } return 0; }