結果
| 問題 |
No.454 逆2乗和
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-12-05 16:07:21 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 36 ms / 2,000 ms |
| コード長 | 253 bytes |
| コンパイル時間 | 204 ms |
| コンパイル使用メモリ | 21,120 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-30 02:45:22 |
| 合計ジャッジ時間 | 2,200 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%lf",&x);
| ^~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
#define PI 1.6449340668482426
int main(){
double h,i,x,x2,ans=0.0;
scanf("%lf",&x);
i=1.0;
x2=x*x;
while((h=(x2+x*i*2.0)/(i*i*(i+x)*(i+x)))>0.000000000000000001){
ans+=h;
i+=1.0;
}
printf("%15.14f\n",PI-ans);
return 0;
}