結果

問題 No.456 Millions of Submits!
ユーザー くれちーくれちー
提出日時 2016-12-08 00:44:40
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 3,951 ms / 4,500 ms
コード長 550 bytes
コンパイル時間 1,261 ms
コンパイル使用メモリ 26,140 KB
実行使用メモリ 4,392 KB
最終ジャッジ日時 2023-08-12 01:52:46
合計ジャッジ時間 15,758 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,384 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,384 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 5 ms
4,376 KB
testcase_08 AC 4 ms
4,380 KB
testcase_09 AC 41 ms
4,376 KB
testcase_10 AC 42 ms
4,376 KB
testcase_11 AC 400 ms
4,380 KB
testcase_12 AC 3,951 ms
4,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <math.h>

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

	double a, b, t, ans;
	int i;

	for (i = 0; i < m; i++) {
		scanf("%lf %lf %lf", &a, &b, &t);

		if (a == 0) ans = exp(pow(t, 1.0 / b));
		else if (b == 0) ans = pow(t, 1.0 / a);
		else {
			double n = 1.0;
			double tmp1 = pow(t, 1.0 / b);
			double tmp2 = a / b;

			while (1) {
				double tmp3 = n - exp(tmp1 / pow(n, tmp2));

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

	return 0;
}
0