結果

問題 No.1278 どんな級数?
ユーザー hirose_golfhirose_golf
提出日時 2020-10-30 22:23:39
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 208 ms / 2,000 ms
コード長 293 bytes
コンパイル時間 61 ms
使用メモリ 42,480 KB
最終ジャッジ日時 2023-02-21 13:57:35
合計ジャッジ時間 18,268 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 201 ms
41,800 KB
testcase_01 AC 203 ms
41,956 KB
testcase_02 AC 198 ms
42,260 KB
testcase_03 AC 196 ms
42,056 KB
testcase_04 AC 200 ms
42,052 KB
testcase_05 AC 205 ms
42,164 KB
testcase_06 AC 204 ms
41,740 KB
testcase_07 AC 203 ms
41,764 KB
testcase_08 AC 202 ms
41,756 KB
testcase_09 AC 202 ms
42,480 KB
testcase_10 AC 202 ms
41,796 KB
testcase_11 AC 204 ms
41,776 KB
testcase_12 AC 199 ms
42,324 KB
testcase_13 AC 208 ms
41,772 KB
testcase_14 AC 204 ms
41,748 KB
testcase_15 AC 197 ms
41,756 KB
testcase_16 AC 201 ms
41,792 KB
testcase_17 AC 196 ms
41,672 KB
testcase_18 AC 201 ms
41,796 KB
testcase_19 AC 206 ms
41,948 KB
testcase_20 AC 199 ms
41,668 KB
testcase_21 AC 203 ms
41,752 KB
testcase_22 AC 204 ms
41,820 KB
testcase_23 AC 202 ms
41,908 KB
testcase_24 AC 200 ms
41,928 KB
testcase_25 AC 202 ms
41,900 KB
testcase_26 AC 203 ms
42,224 KB
testcase_27 AC 202 ms
41,724 KB
testcase_28 AC 200 ms
41,916 KB
testcase_29 AC 201 ms
41,752 KB
testcase_30 AC 199 ms
41,920 KB
testcase_31 AC 202 ms
41,888 KB
testcase_32 AC 205 ms
41,864 KB
testcase_33 AC 202 ms
41,900 KB
testcase_34 AC 204 ms
41,896 KB
testcase_35 AC 201 ms
41,896 KB
testcase_36 AC 199 ms
41,944 KB
testcase_37 AC 204 ms
41,956 KB
testcase_38 AC 199 ms
41,856 KB
testcase_39 AC 201 ms
41,900 KB
testcase_40 AC 198 ms
41,804 KB
testcase_41 AC 204 ms
41,868 KB
testcase_42 AC 200 ms
41,904 KB
testcase_43 AC 202 ms
41,836 KB
testcase_44 AC 201 ms
42,188 KB
testcase_45 AC 202 ms
41,900 KB
testcase_46 AC 199 ms
41,892 KB
testcase_47 AC 206 ms
41,816 KB
testcase_48 AC 203 ms
41,968 KB
testcase_49 AC 205 ms
41,960 KB
testcase_50 AC 205 ms
41,860 KB
testcase_51 AC 206 ms
41,916 KB
testcase_52 AC 208 ms
41,956 KB
testcase_53 AC 199 ms
41,904 KB
testcase_54 AC 204 ms
41,968 KB
testcase_55 AC 203 ms
41,764 KB
testcase_56 AC 202 ms
42,160 KB
testcase_57 AC 199 ms
41,880 KB
testcase_58 AC 198 ms
41,796 KB
testcase_59 AC 198 ms
41,736 KB
testcase_60 AC 200 ms
41,896 KB
testcase_61 AC 204 ms
42,184 KB
testcase_62 AC 200 ms
41,900 KB
testcase_63 AC 203 ms
41,780 KB
testcase_64 AC 203 ms
41,792 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