結果

問題 No.1273 はじめのζ関数
ユーザー nagissnagiss
提出日時 2020-10-30 21:45:41
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 489 ms / 2,000 ms
コード長 479 bytes
コンパイル時間 61 ms
使用メモリ 11,836 KB
最終ジャッジ日時 2023-02-21 11:55:41
合計ジャッジ時間 20,516 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 472 ms
9,764 KB
testcase_01 AC 485 ms
11,836 KB
testcase_02 AC 475 ms
7,864 KB
testcase_03 AC 471 ms
7,936 KB
testcase_04 AC 477 ms
9,712 KB
testcase_05 AC 478 ms
7,940 KB
testcase_06 AC 469 ms
9,760 KB
testcase_07 AC 484 ms
9,700 KB
testcase_08 AC 473 ms
7,820 KB
testcase_09 AC 479 ms
7,684 KB
testcase_10 AC 475 ms
7,720 KB
testcase_11 AC 475 ms
7,772 KB
testcase_12 AC 476 ms
7,728 KB
testcase_13 AC 470 ms
7,864 KB
testcase_14 AC 483 ms
7,688 KB
testcase_15 AC 473 ms
7,828 KB
testcase_16 AC 476 ms
7,780 KB
testcase_17 AC 473 ms
7,940 KB
testcase_18 AC 471 ms
7,696 KB
testcase_19 AC 489 ms
7,936 KB
testcase_20 AC 16 ms
7,816 KB
testcase_21 AC 415 ms
7,684 KB
testcase_22 AC 470 ms
7,724 KB
testcase_23 AC 470 ms
7,828 KB
testcase_24 AC 478 ms
7,936 KB
testcase_25 AC 463 ms
7,880 KB
testcase_26 AC 376 ms
7,692 KB
testcase_27 AC 379 ms
9,736 KB
testcase_28 AC 399 ms
9,708 KB
testcase_29 AC 377 ms
9,760 KB
testcase_30 AC 406 ms
7,780 KB
testcase_31 AC 471 ms
7,700 KB
testcase_32 AC 397 ms
9,668 KB
testcase_33 AC 460 ms
9,732 KB
testcase_34 AC 457 ms
7,884 KB
testcase_35 AC 472 ms
7,696 KB
testcase_36 AC 416 ms
7,720 KB
testcase_37 AC 402 ms
7,688 KB
testcase_38 AC 436 ms
7,880 KB
testcase_39 AC 455 ms
7,740 KB
testcase_40 AC 480 ms
8,028 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