結果

問題 No.456 Millions of Submits!
ユーザー くれちーくれちー
提出日時 2016-12-07 23:44:25
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 525 bytes
コンパイル時間 2,146 ms
コンパイル使用メモリ 33,424 KB
実行使用メモリ 7,604 KB
最終ジャッジ日時 2023-09-05 08:08:03
合計ジャッジ時間 11,354 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 3 ms
4,376 KB
testcase_06 AC 3 ms
4,376 KB
testcase_07 AC 14 ms
4,380 KB
testcase_08 AC 14 ms
4,376 KB
testcase_09 AC 125 ms
4,380 KB
testcase_10 AC 126 ms
4,376 KB
testcase_11 AC 1,228 ms
4,376 KB
testcase_12 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cmath>
using namespace std;

int main() {
	double m;
	scanf("%lf", &m);

	int a, b;
	double t, ans;

	for (int i = 0; i < m; i++) {
		scanf("%d %d %lf", &a, &b, &t);
		if (b == 0) ans = pow(t, 1.0 / a);
		else {
			for (double n = 1.0;;) {
				double tmp1 = pow(t, 1.0 / b);
				double tmp2 = pow(n, (double)a / b);
				double tmp3 = n - exp(tmp1 / tmp2);

				if (abs(tmp3) < 10e-10) {
					ans = n;
					break;
				}
				else n -= tmp3 / 8.0;
			}
		}
		printf("%.10lf\n", ans);
	}

	return 0;
}
0