結果
問題 | No.1118 sin(x)/xの二乗和 |
ユーザー |
![]() |
提出日時 | 2020-07-17 23:21:00 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 185 ms / 2,000 ms |
コード長 | 735 bytes |
コンパイル時間 | 2,030 ms |
コンパイル使用メモリ | 192,556 KB |
最終ジャッジ日時 | 2025-01-11 23:27:05 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include <bits/stdc++.h>using namespace std;template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}using Int = long long;const char newl = '\n';template<typename T> void drop(const T &x){cout<<x<<endl;exit(0);}struct Precision{Precision(){cout<<fixed<<setprecision(12);}}precision_beet;//INSERT ABOVE HEREsigned main(){cin.tie(0);ios::sync_with_stdio(0);using D = double;D x;cin>>x;if(x==0) drop("2.07079632677096370230");const int LIM = 1e7;D ans=0;for(int j=0;j<LIM;j++)ans+=(sin(x+j)/(x+j))*(sin(x+j)/(x+j));ans+=1.0/(2.0*(x+LIM+0.5));cout<<ans<<newl;return 0;}