結果

問題 No.456 Millions of Submits!
コンテスト
ユーザー Yamyuki
提出日時 2016-12-08 12:20:02
言語 C90(gcc15)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
TLE  
(最新)
CE  
(最初)
実行時間 -
コード長 943 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 252 ms
コンパイル使用メモリ 39,544 KB
最終ジャッジ日時 2026-02-23 23:24:33
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 TLE * 1 -- * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

int a,b;
double time;

double beki(double x,int n){
	if(n==0) return 1;
	return x*beki(x,n-1);
}

double result(double x){
	return beki(x,a)*beki(log(x),b);
}

double newresult(double x){
	return (x*log(x)-time)/((double)a*log(x)+(double)b);
}


int main(){
	long m,i;
	double s,e,dif;
	scanf("%ld",&m);
	for(i=0;i<m;i++){
		scanf("%d %d %lf",&a,&b,&time);
		if(a==0){
			printf("%.10f\n",pow(2.718281828459,pow(time,1.0/(double)b)));
		}else if(b==0){
			printf("%.10f\n",pow(time,1.0/(double)a));;
		}else{
			/*s=1.0;
		e=22027.0;
		dif=time-result((s+e)/2.0);
		while(dif>0.000000001 || dif<-0.000000001){
			if(dif>0){
				s=(s+e)/2.0;
			}else{
				e=(s+e)/2.0;
			}
			dif=time-result((s+e)/2.0);
		}
		printf("%.10f\n",(s+e)/2);
		*/
		s=1.0;
		dif=time-result(s);
		while(dif>0.00000001 || dif<-0.00000001){
			s-=newresult(s);
			dif=time-result(s);
		}
		printf("%.10f\n",s);
		}
	}
	return 0;
}
0