結果

問題 No.1273 はじめのζ関数
ユーザー realDivineJKrealDivineJK
提出日時 2020-10-30 22:07:27
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 306 ms / 2,000 ms
コード長 649 bytes
コンパイル時間 57 ms
使用メモリ 9,816 KB
最終ジャッジ日時 2023-02-21 12:49:07
合計ジャッジ時間 13,136 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 208 ms
7,988 KB
testcase_01 AC 306 ms
8,092 KB
testcase_02 AC 295 ms
9,696 KB
testcase_03 AC 294 ms
9,696 KB
testcase_04 AC 291 ms
9,652 KB
testcase_05 AC 129 ms
7,852 KB
testcase_06 AC 292 ms
7,992 KB
testcase_07 AC 294 ms
7,844 KB
testcase_08 AC 298 ms
9,708 KB
testcase_09 AC 296 ms
9,760 KB
testcase_10 AC 301 ms
7,992 KB
testcase_11 AC 127 ms
7,928 KB
testcase_12 AC 292 ms
7,864 KB
testcase_13 AC 301 ms
8,112 KB
testcase_14 AC 292 ms
9,744 KB
testcase_15 AC 292 ms
9,740 KB
testcase_16 AC 293 ms
9,740 KB
testcase_17 AC 291 ms
9,816 KB
testcase_18 AC 292 ms
9,772 KB
testcase_19 AC 296 ms
7,992 KB
testcase_20 AC 15 ms
7,736 KB
testcase_21 AC 295 ms
8,072 KB
testcase_22 AC 300 ms
8,032 KB
testcase_23 AC 298 ms
9,760 KB
testcase_24 AC 296 ms
7,880 KB
testcase_25 AC 300 ms
8,012 KB
testcase_26 AC 295 ms
8,072 KB
testcase_27 AC 297 ms
9,756 KB
testcase_28 AC 300 ms
8,060 KB
testcase_29 AC 299 ms
8,064 KB
testcase_30 AC 296 ms
7,912 KB
testcase_31 AC 293 ms
9,768 KB
testcase_32 AC 297 ms
8,060 KB
testcase_33 AC 298 ms
7,908 KB
testcase_34 AC 298 ms
7,964 KB
testcase_35 AC 298 ms
9,636 KB
testcase_36 AC 302 ms
8,148 KB
testcase_37 AC 303 ms
8,060 KB
testcase_38 AC 297 ms
7,932 KB
testcase_39 AC 299 ms
8,140 KB
testcase_40 AC 16 ms
7,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x = int(input())
pi = 3.14159265358979323846264338
#1.634983900184893
safety = [6, 200000, 90, 100000, 945, 100000, 9450, 50000, 93555]
L = [0 for _ in range(2, x+1)]
for i in range(2, x):
    if i <= 7:
        S = 0
        if i % 2:
            for j in range(safety[i-2], 0, -1):
                S += 1 / pow(j, i)
            L[i-2] = S - 1
        else:
            S = pow(pi, i) / safety[i-2]
            L[i-2] = S - 1
    else:
        S = 0
        for j in range(100, 0, -1):
            S += 1 / pow(j, i)
        L[i-2] = S - 1
        if S == 1:
            break
X = 1
for i in range(x-2, -1, -1):
    X -= L[i]
print(int(X*1000000))
0