結果

問題 No.456 Millions of Submits!
ユーザー butsurizukibutsurizuki
提出日時 2016-12-08 22:52:10
言語 C90
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 733 bytes
コンパイル時間 491 ms
コンパイル使用メモリ 27,192 KB
実行使用メモリ 32,252 KB
最終ジャッジ日時 2023-09-05 21:14:31
合計ジャッジ時間 8,654 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<stdio.h>
#include<math.h>
#define e 2.7182818284590452355

double big(double a,double b){if(a>b){return a;}return b;}

int main(void){
	int i,j,n,a,b;
	double min,max,c,d,t,ax,bx,cax,cbx,dax,dbx;
	scanf("%d",&n);
	for(i = 1;i <= n;i++){
		scanf("%d%d%lf",&a,&b,&t);
		if(a && b){min = 1;max = big(e,t);}
		else if(b == 0){ax = a;printf("%.12lf\n",pow(t,1/ax));continue;}
		else{bx = b;printf("%.12lf\n",pow(e,pow(t,1/bx)));continue;}
		for(j = 1;j <= 20;j++){
			c = (min*2+max)/3;
			d = (min+max*2)/3;
			cax = pow(c,a);dax = pow(d,a);
			cbx = pow(log(c),b);dbx = pow(log(d),b);
			if(dax*dbx < t){min = d;}
			else if(cax*cbx > t){max = c;}
			else{min = c;max = d;}
		}
		printf("%.12lf\n",(max+min)/2);
	}
	return 0;
}
0