結果

問題 No.1273 はじめのζ関数
ユーザー nagissnagiss
提出日時 2020-10-30 21:45:41
言語 Python3
(3.11.2 + numpy 1.24.2 + scipy 1.10.1)
結果
AC  
実行時間 480 ms / 2,000 ms
コード長 479 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 8,328 KB
最終ジャッジ日時 2023-07-08 03:58:54
合計ジャッジ時間 20,460 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 475 ms
7,968 KB
testcase_01 AC 469 ms
7,908 KB
testcase_02 AC 478 ms
8,084 KB
testcase_03 AC 474 ms
8,292 KB
testcase_04 AC 474 ms
7,904 KB
testcase_05 AC 472 ms
7,936 KB
testcase_06 AC 480 ms
7,892 KB
testcase_07 AC 444 ms
7,932 KB
testcase_08 AC 472 ms
7,888 KB
testcase_09 AC 446 ms
8,220 KB
testcase_10 AC 435 ms
7,980 KB
testcase_11 AC 434 ms
7,960 KB
testcase_12 AC 428 ms
8,032 KB
testcase_13 AC 432 ms
7,896 KB
testcase_14 AC 439 ms
7,992 KB
testcase_15 AC 473 ms
7,900 KB
testcase_16 AC 443 ms
7,980 KB
testcase_17 AC 458 ms
8,036 KB
testcase_18 AC 454 ms
7,928 KB
testcase_19 AC 452 ms
7,936 KB
testcase_20 AC 16 ms
8,328 KB
testcase_21 AC 367 ms
7,896 KB
testcase_22 AC 436 ms
7,980 KB
testcase_23 AC 422 ms
7,896 KB
testcase_24 AC 424 ms
7,964 KB
testcase_25 AC 428 ms
7,956 KB
testcase_26 AC 339 ms
7,900 KB
testcase_27 AC 345 ms
7,904 KB
testcase_28 AC 375 ms
7,904 KB
testcase_29 AC 346 ms
7,952 KB
testcase_30 AC 377 ms
7,904 KB
testcase_31 AC 414 ms
8,088 KB
testcase_32 AC 358 ms
7,968 KB
testcase_33 AC 442 ms
7,940 KB
testcase_34 AC 444 ms
7,964 KB
testcase_35 AC 449 ms
7,964 KB
testcase_36 AC 397 ms
7,900 KB
testcase_37 AC 360 ms
7,884 KB
testcase_38 AC 387 ms
8,008 KB
testcase_39 AC 416 ms
7,844 KB
testcase_40 AC 426 ms
7,988 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