結果

問題 No.456 Millions of Submits!
コンテスト
ユーザー くれちー
提出日時 2016-12-07 23:47:19
言語 C90
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
TLE  
(最新)
CE  
(最初)
実行時間 -
コード長 511 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 305 ms
コンパイル使用メモリ 38,680 KB
最終ジャッジ日時 2026-02-23 23:19:58
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other TLE * 1 -- * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'main':
main.c:21:41: warning: 'abs' argument 1 type is 'double' where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
   21 |                                 if (abs(tmp3) < 10e-10) {
      |                                         ^~~~
<built-in>: note: built-in 'abs' declared here

ソースコード

diff #
raw source code

#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