結果
| 問題 | No.456 Millions of Submits! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-12-08 13:04:20 |
| 言語 | C90(gcc15) (gcc 15.2.0) |
| 結果 |
WA
(最新)
CE
(最初)
|
| 実行時間 | - |
| コード長 | 958 bytes |
| 記録 | |
| コンパイル時間 | 410 ms |
| コンパイル使用メモリ | 38,016 KB |
| 最終ジャッジ日時 | 2026-02-23 23:25:30 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 WA * 1 |
ソースコード
#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=12027.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.0);
/*
s=22027.0;
dif=time-result(s);
while(dif>0.000000001 || dif<-0.000000001){
s-=newresult(s);
dif=time-result(s);
}
printf("%.10f\n",s);
*/
}
}
return 0;
}