結果

問題 No.1271 初めての級数
ユーザー ayaoniayaoni
提出日時 2020-10-30 21:23:05
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 569 bytes
コンパイル時間 287 ms
使用メモリ 75,904 KB
最終ジャッジ日時 2023-02-21 10:30:19
合計ジャッジ時間 2,484 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 84 ms
75,780 KB
testcase_01 AC 84 ms
75,720 KB
testcase_02 AC 82 ms
75,840 KB
testcase_03 AC 81 ms
75,696 KB
testcase_04 AC 82 ms
75,704 KB
testcase_05 AC 83 ms
75,904 KB
testcase_06 AC 80 ms
75,600 KB
testcase_07 AC 81 ms
75,820 KB
testcase_08 AC 81 ms
75,568 KB
testcase_09 AC 81 ms
75,628 KB
testcase_10 AC 83 ms
75,768 KB
testcase_11 AC 80 ms
75,828 KB
testcase_12 AC 82 ms
75,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from math import pi
sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


k = I()
if k == 0:
    print((pi**2)/6)
    exit()

a = sum(1/i for i in range(1,k+1))
print(a/k)
0