結果

問題 No.1271 初めての級数
ユーザー HAPPAHAPPA
提出日時 2020-10-30 21:32:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 282 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 86,976 KB
実行使用メモリ 75,508 KB
最終ジャッジ日時 2023-09-29 05:03:17
合計ジャッジ時間 3,349 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 159 ms
75,436 KB
testcase_01 AC 161 ms
75,480 KB
testcase_02 AC 162 ms
75,508 KB
testcase_03 AC 158 ms
75,364 KB
testcase_04 AC 160 ms
75,440 KB
testcase_05 AC 159 ms
75,360 KB
testcase_06 AC 163 ms
75,264 KB
testcase_07 AC 158 ms
75,212 KB
testcase_08 AC 158 ms
75,488 KB
testcase_09 AC 161 ms
75,212 KB
testcase_10 AC 160 ms
75,496 KB
testcase_11 AC 162 ms
75,228 KB
testcase_12 AC 161 ms
75,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    k = int(input())
    res = 0
    for i in range(1, 10 ** 7):
        res += 1 / (i * (i + k))
    print(res)


if __name__ == '__main__':
    resolve()
0