結果

問題 No.456 Millions of Submits!
ユーザー akakimidoriakakimidori
提出日時 2017-06-21 11:28:01
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 954 ms / 4,500 ms
コード長 597 bytes
コンパイル時間 544 ms
コンパイル使用メモリ 26,172 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-05 23:51:32
合計ジャッジ時間 8,623 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

double calc(int a,int b,double t){
  if(a==0) return exp(pow(t,(double)1/b));
  if(b==0) return pow(t,(double)1/a);

  double x=log(10);
  double lt=log(t);
  int i;
  for(i=0;i<10;i++){
    double ae=a*exp(x);
    double f=ae+b*x-lt;
    double g=ae+b;
    x-=f/g;
    if(f/g<1e-10) break;
  }
  return exp(exp(x));
}

void run(void){
  int m;
  scanf("%d",&m);
  int i;
  for(i=0;i<m;i++){
    int a,b;
    double t;
    scanf("%d%d%lf",&a,&b,&t);
    double ans=calc(a,b,t);
    printf("%.9lf\n",ans);
  }
  return;
}

int main(void){
  run();
  return 0;
}
0