結果

問題 No.454 逆2乗和
ユーザー xuzijian629
提出日時 2018-11-06 15:55:23
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 505 bytes
コンパイル時間 1,596 ms
コンパイル使用メモリ 193,180 KB
最終ジャッジ日時 2025-01-06 15:38:58
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 30 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
using vi = vector<i64>;
using vvi = vector<vi>;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cout.setf(ios::fixed);
    cout.precision(20);
    double x;
    cin >> x;
    long double y = x;

    long double sum = 0;
    for (int i = 1; i <= 1000000000; i++) {
        long double t = y + i;
        t = t * t;
        sum += 1.0 / t;
    }

    double k = sum;
    cout << k << endl;
}
0