結果

問題 No.456 Millions of Submits!
ユーザー くれちーくれちー
提出日時 2016-12-07 23:47:19
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 511 bytes
コンパイル時間 2,558 ms
コンパイル使用メモリ 25,940 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-05 08:11:26
合計ジャッジ時間 4,370 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
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.c: In function ‘main’:
main.c:21:9: warning: implicit declaration of function ‘abs’ [-Wimplicit-function-declaration]
     if (abs(tmp3) < 10e-10) {
         ^~~

ソースコード

diff #

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

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

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

	for (i = 0; i < m; i++) {
		scanf("%d %d %lf", &a, &b, &t);
		if (b == 0) ans = pow(t, 1.0 / a);
		else {
			double n = 1.0;
			while (1) {
				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 / 4.0;
			}
		}
		printf("%.10lf\n", ans);
	}

	return 0;
}
0