結果
問題 |
No.456 Millions of Submits!
|
ユーザー |
|
提出日時 | 2017-08-18 09:58:36 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 930 ms / 4,500 ms |
コード長 | 595 bytes |
コンパイル時間 | 311 ms |
コンパイル使用メモリ | 31,616 KB |
実行使用メモリ | 25,596 KB |
最終ジャッジ日時 | 2024-06-23 19:13:03 |
合計ジャッジ時間 | 8,157 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:20:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 20 | scanf("%d",&m); | ~~~~~^~~~~~~~~ main.cpp:21:29: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 21 | for(int i=0;i<m;i++) scanf("%d%d%lf",&A[i],&B[i],&T[i]); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#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(11); for(int i=0;i<10;i++){ double f=a*exp(x)+b*x-log(t); double g=a*exp(x)+b; x-=f/g; } return exp(exp(x)); } int A[1000000],B[1000000]; double T[1000000],ANS[1000000]; int main(){ int m; scanf("%d",&m); for(int i=0;i<m;i++) scanf("%d%d%lf",&A[i],&B[i],&T[i]); //#pragma omp parallel for for(int i=0;i<m;i++){ ANS[i]=calc(A[i],B[i],T[i]); } for(int i=0;i<m;i++) printf("%.9lf\n",ANS[i]); }