結果

問題 No.1273 はじめのζ関数
ユーザー tanon710tanon710
提出日時 2020-10-30 22:28:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 506 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 96,184 KB
最終ジャッジ日時 2023-09-29 07:06:08
合計ジャッジ時間 27,818 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,056 ms
94,888 KB
testcase_01 AC 1,061 ms
94,752 KB
testcase_02 AC 1,019 ms
95,800 KB
testcase_03 AC 881 ms
94,656 KB
testcase_04 AC 1,035 ms
93,720 KB
testcase_05 WA -
testcase_06 AC 921 ms
93,612 KB
testcase_07 AC 1,051 ms
95,688 KB
testcase_08 AC 874 ms
94,120 KB
testcase_09 AC 971 ms
94,668 KB
testcase_10 AC 868 ms
95,300 KB
testcase_11 AC 1,073 ms
94,704 KB
testcase_12 AC 1,061 ms
95,224 KB
testcase_13 AC 225 ms
88,900 KB
testcase_14 AC 1,064 ms
94,844 KB
testcase_15 AC 1,039 ms
95,084 KB
testcase_16 AC 1,031 ms
94,384 KB
testcase_17 AC 1,063 ms
96,184 KB
testcase_18 AC 1,004 ms
94,796 KB
testcase_19 AC 1,004 ms
94,288 KB
testcase_20 WA -
testcase_21 AC 217 ms
88,916 KB
testcase_22 AC 217 ms
88,876 KB
testcase_23 AC 218 ms
89,088 KB
testcase_24 AC 218 ms
89,116 KB
testcase_25 AC 221 ms
88,888 KB
testcase_26 AC 222 ms
88,996 KB
testcase_27 AC 224 ms
88,892 KB
testcase_28 AC 225 ms
89,092 KB
testcase_29 AC 221 ms
88,688 KB
testcase_30 AC 218 ms
88,832 KB
testcase_31 AC 216 ms
89,092 KB
testcase_32 AC 221 ms
89,004 KB
testcase_33 AC 221 ms
89,120 KB
testcase_34 AC 219 ms
89,104 KB
testcase_35 AC 221 ms
88,896 KB
testcase_36 AC 219 ms
88,912 KB
testcase_37 AC 219 ms
89,140 KB
testcase_38 AC 217 ms
88,884 KB
testcase_39 AC 220 ms
89,096 KB
testcase_40 AC 1,058 ms
94,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
import decimal

decimal.getcontext().prec=100

def zeta(n):
    if n==2:
        return math.pi**2/6-1
    elif n==3:
        return decimal.Decimal(0.202056903159594)
    else:
        ret=decimal.Decimal(0)
        for i in range(2,100):
            ret+=decimal.Decimal(1)/decimal.Decimal(i**n)
        return ret

n=int(input())
if n>=100:
    print(0)
elif n==2:
    print(999999)
else:
    ans=decimal.Decimal(0)
    for i in range(n,300):
        ans+=zeta(i)
    print(int(ans*(10**6)))
0