結果
問題 | No.1118 sin(x)/xの二乗和 |
ユーザー |
|
提出日時 | 2020-07-19 13:05:26 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 230 ms / 2,000 ms |
コード長 | 583 bytes |
コンパイル時間 | 1,001 ms |
コンパイル使用メモリ | 106,864 KB |
最終ジャッジ日時 | 2025-01-12 00:49:17 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <map> #include <queue> #include <cstdio> #include <ctime> #include <assert.h> #include <chrono> #include <random> #include <numeric> #include <set> using namespace std; typedef long long int ll; typedef unsigned long long ull; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); double x; cin >> x; double res=0; if(x==0){ res+=1; x+=1.0; } for(int i=0;i<1e7;i++){ res+=(sin(x)/(x))*(sin(x)/(x)); x+=1.0; } printf("%.9f\n",res+5.0*1e-8); }