結果
問題 | No.456 Millions of Submits! |
ユーザー |
![]() |
提出日時 | 2016-12-08 00:06:33 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,607 bytes |
コンパイル時間 | 870 ms |
コンパイル使用メモリ | 81,096 KB |
実行使用メモリ | 25,600 KB |
最終ジャッジ日時 | 2024-06-23 04:35:11 |
合計ジャッジ時間 | 7,027 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 29 ms
25,328 KB |
testcase_01 | WA | - |
testcase_02 | AC | 30 ms
25,448 KB |
testcase_03 | AC | 31 ms
25,424 KB |
testcase_04 | AC | 32 ms
25,588 KB |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:48:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 48 | scanf("%d %d %lf", &a, &b, &c); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <algorithm> #include <complex> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--) using namespace std; typedef long long int lli; typedef pair<lli, lli> P; lli MOD = 1000000007; double dp[11][11][23000]; //dp[a][b][n]; void fill() { for (int n = 1; n < 23000; n++) { dp[0][0][n] = 1.0; rep(i, 10) rep(j, 10) { double l = (double)(n); dp[i + 1][j][n] = dp[i][j][n] * l; dp[i][j + 1][n] = dp[i][j][n] * log(l); } } } struct tmp { double operator()(const int a, const int b, const double c) { double ans = 1; rep(i, a) ans *= c; rep(i, b) ans *= log(c); return ans; } } f; int main() { int m; cin >> m; int a, b; double c; fill(); rep(i, m) { scanf("%d %d %lf", &a, &b, &c); int up = 23000, low = 0; while (up - low > 1) { int mid = (up + low) / 2; if (dp[a][b][mid] < c) { low = mid; } else { up = mid; } } double upd = (double)up; double lowd = (double)low; int cnt = 0; while (upd - lowd > 1e-10 && cnt < 50) { cnt++; double midd = (upd + lowd) / 2; if (f(a, b, midd) < c) { lowd = midd; } else { upd = midd; } } printf("%.15f\n", upd); } }