結果

問題 No.1271 初めての級数
ユーザー LoptallLoptall
提出日時 2020-10-30 21:38:49
言語 Python3
(3.11.2 + numpy 1.24.2 + scipy 1.10.1)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 191 bytes
コンパイル時間 412 ms
実行使用メモリ 9,752 KB
最終ジャッジ日時 2023-02-21 11:31:32
合計ジャッジ時間 1,389 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
9,732 KB
testcase_01 AC 16 ms
7,832 KB
testcase_02 AC 16 ms
7,828 KB
testcase_03 AC 15 ms
9,708 KB
testcase_04 AC 16 ms
7,824 KB
testcase_05 AC 15 ms
9,732 KB
testcase_06 AC 15 ms
9,752 KB
testcase_07 AC 16 ms
9,744 KB
testcase_08 AC 15 ms
9,748 KB
testcase_09 AC 15 ms
7,776 KB
testcase_10 AC 16 ms
9,704 KB
testcase_11 AC 16 ms
7,756 KB
testcase_12 AC 15 ms
9,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

k = int(input())

if k == 0:
    print((3.1415926536897932384626433832795028841971 ** 2) / 6)
else:
    h = 0.0
    for i in range(1, k + 1):
        h += 1 / i
    ans = h / k
    print(ans)
0