結果

問題 No.1273 はじめのζ関数
ユーザー nagissnagiss
提出日時 2020-10-30 21:45:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 476 ms / 2,000 ms
コード長 479 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 10,636 KB
実行使用メモリ 8,276 KB
最終ジャッジ日時 2023-09-29 05:41:50
合計ジャッジ時間 19,982 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 470 ms
8,088 KB
testcase_01 AC 476 ms
7,928 KB
testcase_02 AC 473 ms
7,976 KB
testcase_03 AC 470 ms
8,044 KB
testcase_04 AC 469 ms
7,936 KB
testcase_05 AC 470 ms
8,052 KB
testcase_06 AC 469 ms
8,112 KB
testcase_07 AC 473 ms
7,924 KB
testcase_08 AC 469 ms
7,908 KB
testcase_09 AC 473 ms
7,996 KB
testcase_10 AC 469 ms
7,916 KB
testcase_11 AC 470 ms
7,976 KB
testcase_12 AC 469 ms
7,964 KB
testcase_13 AC 472 ms
7,916 KB
testcase_14 AC 475 ms
8,044 KB
testcase_15 AC 468 ms
7,964 KB
testcase_16 AC 469 ms
8,024 KB
testcase_17 AC 473 ms
7,904 KB
testcase_18 AC 475 ms
8,080 KB
testcase_19 AC 473 ms
7,980 KB
testcase_20 AC 15 ms
8,276 KB
testcase_21 AC 406 ms
8,088 KB
testcase_22 AC 470 ms
8,036 KB
testcase_23 AC 463 ms
8,048 KB
testcase_24 AC 469 ms
7,996 KB
testcase_25 AC 464 ms
7,920 KB
testcase_26 AC 375 ms
7,992 KB
testcase_27 AC 380 ms
7,992 KB
testcase_28 AC 390 ms
8,124 KB
testcase_29 AC 378 ms
7,920 KB
testcase_30 AC 407 ms
7,920 KB
testcase_31 AC 457 ms
7,940 KB
testcase_32 AC 394 ms
7,968 KB
testcase_33 AC 463 ms
7,944 KB
testcase_34 AC 455 ms
8,136 KB
testcase_35 AC 472 ms
8,044 KB
testcase_36 AC 415 ms
7,920 KB
testcase_37 AC 397 ms
8,028 KB
testcase_38 AC 436 ms
7,964 KB
testcase_39 AC 443 ms
7,928 KB
testcase_40 AC 471 ms
8,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import pi, floor

def zeta_m1(n):
    if n == 2:
        return pi*pi/6 - 1.0
    elif n == 3:
        return 0.202056903159594
    elif n == 4:
        return pi**4/90 - 1.0
    res = 0
    for i in range(2, 1000):
        denom = i ** n
        if denom > 1e12:
            break
        res += 1 / denom
    return res

X = int(input())
if X == 2:
    print(1000000)
    exit()
ans = 0
for i in range(X, 20000):
    ans += zeta_m1(i)

print(int(floor(ans*1000000)))
0