結果

問題 No.1271 初めての級数
ユーザー c-yanc-yan
提出日時 2020-10-30 21:43:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 587 ms / 2,000 ms
コード長 215 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 10,536 KB
実行使用メモリ 49,128 KB
最終ジャッジ日時 2023-09-29 05:36:25
合計ジャッジ時間 8,886 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 571 ms
48,940 KB
testcase_01 AC 582 ms
49,128 KB
testcase_02 AC 561 ms
48,996 KB
testcase_03 AC 579 ms
48,964 KB
testcase_04 AC 563 ms
49,096 KB
testcase_05 AC 536 ms
49,120 KB
testcase_06 AC 555 ms
49,044 KB
testcase_07 AC 576 ms
49,096 KB
testcase_08 AC 552 ms
49,116 KB
testcase_09 AC 587 ms
48,932 KB
testcase_10 AC 543 ms
49,044 KB
testcase_11 AC 545 ms
49,000 KB
testcase_12 AC 569 ms
49,076 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