結果

問題 No.1278 どんな級数?
ユーザー kozy
提出日時 2020-10-29 23:18:12
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 332 bytes
コンパイル時間 201 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 18,080 KB
最終ジャッジ日時 2024-07-21 22:45:10
合計ジャッジ時間 8,792 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30 WA * 6 TLE * 1 -- * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#aaaaaaaaaaaaaaaaaaaaaaaaa
def zeta(s):
    ans=0
    for i in range(1,100000):
        ans+=1/pow(i,s)
    return ans
x,n=map(int,input().split())
if x==1:
    print((pow(2,n+1)-1)/(pow(2,n+1)))
else:
    if n==1:
        print("0.5")
    elif n==2:
        print("0.644934033")
    else:
        print(n-1*zeta(n)-(n-2)*zeta(n-1))
0