結果

問題 No.1118 sin(x)/xの二乗和
ユーザー fastmathfastmath
提出日時 2020-07-19 05:03:40
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 840 bytes
コンパイル時間 2,062 ms
コンパイル使用メモリ 163,528 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-05-09 06:34:36
合計ジャッジ時間 48,117 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ii pair <int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcountll
#define ll long long
#define mp make_pair
#define f first
#define s second
#define Time (double)clock()/CLOCKS_PER_SEC
#define debug(x) std::cout << #x << ": " << x << '\n';
#define double long double
signed main() {
    #ifdef HOME
    freopen("input.txt", "r", stdin);
    #else
    #define endl '\n'
    ios_base::sync_with_stdio(0); cin.tie(0);
    #endif

    double ans = 0;
    double x;
    cin >> x;

    auto f = [] (double x) {
        if (x == 0)
            return (double)1.;
        else
            return sinl(x)/x;
    };

    for (; x < 1e7; ++x) 
        ans += f(x);

    cout.precision(20);
    cout << fixed;
    cout << ans << endl;
}
0