結果
問題 | No.456 Millions of Submits! |
ユーザー | Yamyuki |
提出日時 | 2016-12-08 12:19:01 |
言語 | C90 (gcc 11.4.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 945 bytes |
コンパイル時間 | 469 ms |
コンパイル使用メモリ | 26,256 KB |
実行使用メモリ | 4,384 KB |
最終ジャッジ日時 | 2023-09-05 13:38:08 |
合計ジャッジ時間 | 7,720 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,376 KB |
testcase_01 | TLE | - |
testcase_02 | -- | - |
testcase_03 | -- | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
ソースコード
#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.000000001 || dif<-0.000000001){ s-=newresult(s); dif=time-result(s); } printf("%.10f\n",s); } } return 0; }