結果
| 問題 | 
                            No.1118 sin(x)/xの二乗和
                             | 
                    
| コンテスト | |
| ユーザー | 
                             夕叢霧香(ゆうむらきりか)
                         | 
                    
| 提出日時 | 2019-09-28 11:42:04 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 42 ms / 2,000 ms | 
| コード長 | 517 bytes | 
| コンパイル時間 | 1,007 ms | 
| コンパイル使用メモリ | 96,248 KB | 
| 最終ジャッジ日時 | 2025-01-07 19:47:29 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 20 | 
ソースコード
#include<algorithm>
#include<iostream>
#include<cmath>
#include<vector>
#include<iomanip>
using namespace std;
typedef long long lint;
typedef vector<int>vi;
typedef pair<int,int>pii;
#define rep(i,n)for(int i=0;i<(int)(n);++i)
#define ANS0 2.07079632677096370230
#define N 1000000
double sinc(double x){return x==0?1:sin(x)/x;}
double sincsq(double x){double a=sinc(x);return a*a;}
int main(){
  double x;cin>>x;
  double a=ANS0;
  rep(i,N){
    a+=sincsq(x+i)-sincsq(i);
  }
  cout<<setprecision(15)<<a<<endl;
}
            
            
            
        
            
夕叢霧香(ゆうむらきりか)