結果

問題 No.456 Millions of Submits!
コンテスト
ユーザー くれちー
提出日時 2016-12-08 00:44:40
言語 C90(gcc15)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 2,863 ms / 4,500 ms
コード長 550 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,455 ms
コンパイル使用メモリ 37,884 KB
最終ジャッジ日時 2026-02-23 23:21:58
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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