結果

問題 No.881 sin(x)/xの和
ユーザー masa_ahemasa_ahe
提出日時 2019-09-13 21:29:51
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 876 bytes
コンパイル時間 609 ms
コンパイル使用メモリ 75,008 KB
実行使用メモリ 8,208 KB
最終ジャッジ日時 2023-09-17 06:57:06
合計ジャッジ時間 13,880 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<map>
#include<string>
#include<cstring>
#include<bitset>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<numeric>
#include<set>
#include<math.h>
using namespace std;

const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};

#define rep(i,x) for(int i=0;i<x;i++)
#define re(i,x,y) for(int i=x;i<y;i++)

long long INF=1e9;
const long long mod=2019;
#define ll long long

double sinc(double x){
    if(x!=0){
        return sin(x)/x;
    }
    else{
        return 1;
    }
}

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    double n; cin>>n;
    vector<double>x(n),a(n);
    rep(i,n){
        cin>>x[i]>>a[i];
    }
    double sum=0;
    rep(i,n){
        re(j,-100000,100000){
            sum+=(a[i])*sinc(x[i]+j);
        }
    }
    printf("%.16f\n",sum);
    return 0;
}
0