結果

問題 No.1271 初めての級数
ユーザー ooooobaoooooba
提出日時 2021-07-01 22:27:36
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 513 bytes
コンパイル時間 1,037 ms
コンパイル使用メモリ 114,704 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-10 20:16:31
合計ジャッジ時間 2,022 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
4,376 KB
testcase_01 AC 17 ms
4,380 KB
testcase_02 AC 17 ms
4,376 KB
testcase_03 AC 17 ms
4,380 KB
testcase_04 AC 16 ms
4,380 KB
testcase_05 AC 16 ms
4,380 KB
testcase_06 AC 17 ms
4,376 KB
testcase_07 AC 16 ms
4,380 KB
testcase_08 AC 16 ms
4,380 KB
testcase_09 AC 17 ms
4,380 KB
testcase_10 AC 17 ms
4,380 KB
testcase_11 AC 17 ms
4,380 KB
testcase_12 AC 17 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <optional>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

int main() {
    int32_t k;
    cin >> k;
    double ans = 0;
    for (auto i = int64_t(1000 * 1000 * 10); i > 0; --i) {
        ans += 1.0 / (i * (i + k));
    }
    printf("%.9f\n", ans);
    return 0;
}
0