結果
問題 | No.456 Millions of Submits! |
ユーザー |
|
提出日時 | 2016-12-08 22:42:51 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 3,068 ms / 4,500 ms |
コード長 | 610 bytes |
コンパイル時間 | 245 ms |
コンパイル使用メモリ | 24,192 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 03:13:50 |
合計ジャッジ時間 | 10,360 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | scanf("%d",&n); | ^~~~~~~~~~~~~~ main.c:12:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 12 | scanf("%d%d%lf",&a,&b,&t); | ^~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#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,t,ax,bx; 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 <= 32;j++){ c = (min+max)/2; ax = pow(c,a); bx = pow(log(c),b); if(ax*bx < t){min = c;} else{max = c;} } printf("%.12lf\n",(max+min)/2); } return 0; }