結果

問題 No.1118 sin(x)/xの二乗和
ユーザー vwxyzvwxyz
提出日時 2021-08-17 22:17:02
言語 C++23(draft)
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 373 ms / 2,000 ms
コード長 411 bytes
コンパイル時間 3,842 ms
コンパイル使用メモリ 296,668 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-19 05:51:31
合計ジャッジ時間 12,520 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 361 ms
6,812 KB
testcase_01 AC 370 ms
6,944 KB
testcase_02 AC 364 ms
6,940 KB
testcase_03 AC 359 ms
6,940 KB
testcase_04 AC 358 ms
6,944 KB
testcase_05 AC 359 ms
6,944 KB
testcase_06 AC 367 ms
6,940 KB
testcase_07 AC 370 ms
6,940 KB
testcase_08 AC 361 ms
6,940 KB
testcase_09 AC 372 ms
6,944 KB
testcase_10 AC 362 ms
6,940 KB
testcase_11 AC 373 ms
6,940 KB
testcase_12 AC 363 ms
6,940 KB
testcase_13 AC 369 ms
6,940 KB
testcase_14 AC 364 ms
6,940 KB
testcase_15 AC 362 ms
6,940 KB
testcase_16 AC 365 ms
6,944 KB
testcase_17 AC 358 ms
6,940 KB
testcase_18 AC 360 ms
6,940 KB
testcase_19 AC 366 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <iostream>
#include <math.h>
using namespace std;

double sinc(double x){
    if(x==0){
        return 1;
    }
    else{
        return pow(sin(x),2)/pow(x,2);
    }
}
int main(){
    double ans=2.07079632677096370230;
    double x;cin>>x;
    for(int i=0;i<pow(10,7);i++){
        ans+=sinc(x+i)-sinc(i);
    }
    cout<<setprecision(15)<<ans<<endl;
}
0