結果

問題 No.1278 どんな級数?
ユーザー hirose_golfhirose_golf
提出日時 2020-10-30 22:23:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 229 ms / 2,000 ms
コード長 293 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 10,568 KB
実行使用メモリ 45,416 KB
最終ジャッジ日時 2023-09-29 06:57:01
合計ジャッジ時間 17,535 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 218 ms
45,056 KB
testcase_01 AC 219 ms
45,216 KB
testcase_02 AC 225 ms
45,228 KB
testcase_03 AC 222 ms
45,244 KB
testcase_04 AC 224 ms
45,080 KB
testcase_05 AC 225 ms
45,064 KB
testcase_06 AC 224 ms
45,104 KB
testcase_07 AC 222 ms
45,268 KB
testcase_08 AC 221 ms
45,180 KB
testcase_09 AC 217 ms
45,140 KB
testcase_10 AC 217 ms
45,192 KB
testcase_11 AC 220 ms
45,072 KB
testcase_12 AC 220 ms
45,112 KB
testcase_13 AC 220 ms
45,012 KB
testcase_14 AC 219 ms
45,104 KB
testcase_15 AC 220 ms
45,100 KB
testcase_16 AC 220 ms
45,216 KB
testcase_17 AC 224 ms
45,092 KB
testcase_18 AC 224 ms
45,188 KB
testcase_19 AC 220 ms
45,092 KB
testcase_20 AC 221 ms
45,080 KB
testcase_21 AC 221 ms
45,056 KB
testcase_22 AC 221 ms
45,288 KB
testcase_23 AC 218 ms
45,188 KB
testcase_24 AC 218 ms
45,364 KB
testcase_25 AC 222 ms
45,264 KB
testcase_26 AC 218 ms
45,152 KB
testcase_27 AC 219 ms
45,376 KB
testcase_28 AC 219 ms
45,332 KB
testcase_29 AC 217 ms
45,208 KB
testcase_30 AC 220 ms
45,396 KB
testcase_31 AC 217 ms
45,240 KB
testcase_32 AC 215 ms
45,248 KB
testcase_33 AC 218 ms
45,240 KB
testcase_34 AC 214 ms
45,208 KB
testcase_35 AC 215 ms
45,252 KB
testcase_36 AC 215 ms
45,192 KB
testcase_37 AC 216 ms
45,272 KB
testcase_38 AC 219 ms
45,220 KB
testcase_39 AC 221 ms
45,208 KB
testcase_40 AC 222 ms
45,216 KB
testcase_41 AC 221 ms
45,208 KB
testcase_42 AC 218 ms
45,304 KB
testcase_43 AC 221 ms
45,244 KB
testcase_44 AC 224 ms
45,196 KB
testcase_45 AC 219 ms
45,256 KB
testcase_46 AC 217 ms
45,352 KB
testcase_47 AC 214 ms
45,356 KB
testcase_48 AC 215 ms
45,216 KB
testcase_49 AC 220 ms
45,416 KB
testcase_50 AC 219 ms
45,244 KB
testcase_51 AC 216 ms
45,228 KB
testcase_52 AC 220 ms
45,340 KB
testcase_53 AC 221 ms
45,328 KB
testcase_54 AC 222 ms
45,228 KB
testcase_55 AC 222 ms
45,196 KB
testcase_56 AC 229 ms
45,208 KB
testcase_57 AC 228 ms
45,188 KB
testcase_58 AC 222 ms
45,188 KB
testcase_59 AC 226 ms
45,356 KB
testcase_60 AC 224 ms
45,232 KB
testcase_61 AC 229 ms
45,236 KB
testcase_62 AC 222 ms
45,276 KB
testcase_63 AC 224 ms
45,280 KB
testcase_64 AC 217 ms
45,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from scipy.special import zeta

def main():
    X,K=map(int, input().split())
    if X==1:
        print(1-1/2**(K+1))
    if X==2:
        if K==1:
            print(1/2)
        elif K==2:
            print(zeta(2)-1)
        else:
            print((K-1)*zeta(K)  - (K-2)*zeta(K-1))

main()
0