結果

問題 No.1118 sin(x)/xの二乗和
ユーザー beet
提出日時 2020-07-17 22:45:03
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 705 bytes
コンパイル時間 3,167 ms
コンパイル使用メモリ 192,436 KB
最終ジャッジ日時 2025-01-11 23:10:38
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#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 HERE
signed 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));

  cout<<ans<<newl;
  return 0;
}
0