結果

問題 No.1118 sin(x)/xの二乗和
ユーザー 夕叢霧香(ゆうむらきりか)夕叢霧香(ゆうむらきりか)
提出日時 2019-09-28 11:42:04
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 517 bytes
コンパイル時間 840 ms
コンパイル使用メモリ 98,476 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-09 20:07:14
合計ジャッジ時間 2,316 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
6,816 KB
testcase_01 AC 37 ms
6,940 KB
testcase_02 AC 36 ms
6,940 KB
testcase_03 AC 36 ms
6,944 KB
testcase_04 AC 35 ms
6,940 KB
testcase_05 AC 34 ms
6,944 KB
testcase_06 AC 36 ms
6,944 KB
testcase_07 AC 37 ms
6,944 KB
testcase_08 AC 36 ms
6,940 KB
testcase_09 AC 35 ms
6,944 KB
testcase_10 AC 36 ms
6,944 KB
testcase_11 AC 36 ms
6,940 KB
testcase_12 AC 35 ms
6,940 KB
testcase_13 AC 36 ms
6,940 KB
testcase_14 AC 35 ms
6,944 KB
testcase_15 AC 34 ms
6,944 KB
testcase_16 AC 36 ms
6,940 KB
testcase_17 AC 35 ms
6,940 KB
testcase_18 AC 36 ms
6,944 KB
testcase_19 AC 36 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0