結果

問題 No.1271 初めての級数
ユーザー SDESTINY_kpr
提出日時 2020-10-30 21:38:42
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 1,319 ms / 2,000 ms
コード長 931 bytes
コンパイル時間 346 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-21 23:42:21
合計ジャッジ時間 19,575 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

# import sys
import math #sqrt,gcd,pi,factorial
# import decimal
# import queue # queue
# import bisect
# import heapq # priolity-queue
# from time import time
# from itertools import product,permutations,\
#     combinations,combinations_with_replacement
# 重複あり順列、順列、組み合わせ、重複あり組み合わせ
# import collections # deque
# from operator import itemgetter,mul
# from fractions import Fraction
# from functools import reduce

mod = int(1e9+7)
# mod = 998244353
INF = 1<<50

def readInt():
    return list(map(int,input().split()))

def combination_count(n,r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))

def main():
    k = int(input())
    ans = 0
    n = 1
    while True:
        res = format(1/(n*(n+k)),'.12f')
        if float(res)==0:
            break
        ans += float(res)
        n += 1
    print(ans)
    return

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