結果

問題 No.881 sin(x)/xの和
ユーザー chocoruskchocorusk
提出日時 2019-09-07 16:53:44
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 925 bytes
コンパイル時間 823 ms
コンパイル使用メモリ 97,992 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-09 04:53:16
合計ジャッジ時間 6,659 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 365 ms
4,376 KB
testcase_01 AC 187 ms
4,376 KB
testcase_02 AC 131 ms
4,380 KB
testcase_03 AC 147 ms
4,380 KB
testcase_04 AC 420 ms
4,376 KB
testcase_05 AC 64 ms
4,380 KB
testcase_06 AC 39 ms
4,384 KB
testcase_07 AC 73 ms
4,376 KB
testcase_08 AC 334 ms
4,380 KB
testcase_09 AC 183 ms
4,376 KB
testcase_10 AC 152 ms
4,376 KB
testcase_11 AC 251 ms
4,376 KB
testcase_12 AC 312 ms
4,376 KB
testcase_13 AC 154 ms
4,376 KB
testcase_14 AC 92 ms
4,380 KB
testcase_15 AC 91 ms
4,380 KB
testcase_16 AC 210 ms
4,376 KB
testcase_17 AC 82 ms
4,376 KB
testcase_18 AC 124 ms
4,380 KB
testcase_19 AC 189 ms
4,380 KB
testcase_20 AC 32 ms
4,380 KB
testcase_21 AC 199 ms
4,376 KB
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
double sinc(double x){
	if(abs(x)<1e-7) return 1.0;
	else return sin(x)/x;
}
int main()
{
	int n; cin>>n;
	double ans=0;
	double a[1010], x[1010];
	for(int i=0; i<n; i++){
		cin>>x[i]>>a[i];
		x[i]-=floor(x[i]);
	}
	for(int i=0; i<n; i++){
		for(int j=-10000; j<=10000; j++){
			if(abs(j)==1 && x[i]<1e-10) continue;
			ans-=a[i]*(1/(x[i]+j+1)/(x[i]+j-1))*sinc(x[i]+j)/(2*sin(0.5)*sin(0.5));
		}
	}
	printf("%.10lf\n", ans);
	return 0;
}
0