結果

問題 No.1271 初めての級数
ユーザー c-yanc-yan
提出日時 2020-10-30 21:43:13
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 581 ms / 2,000 ms
コード長 215 bytes
コンパイル時間 69 ms
使用メモリ 48,840 KB
最終ジャッジ日時 2023-02-21 11:47:56
合計ジャッジ時間 9,013 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 581 ms
48,728 KB
testcase_01 AC 575 ms
48,588 KB
testcase_02 AC 559 ms
48,628 KB
testcase_03 AC 569 ms
48,716 KB
testcase_04 AC 556 ms
48,712 KB
testcase_05 AC 570 ms
48,588 KB
testcase_06 AC 579 ms
48,588 KB
testcase_07 AC 573 ms
48,764 KB
testcase_08 AC 559 ms
48,840 KB
testcase_09 AC 579 ms
48,732 KB
testcase_10 AC 552 ms
48,600 KB
testcase_11 AC 557 ms
48,720 KB
testcase_12 AC 557 ms
48,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

k = int(input())

t = [0] * 1048576
for n in range(1, 1048576 + 1):
    t[n - 1] = 1 / (n * (n + k))

x = 1
while x < 1048576:
    for i in range(0, 1048576, x * 2):
        t[i] += t[i + x]
    x *= 2

print(t[0])
0