結果

問題 No.420 mod2漸化式
ユーザー ThetaTheta
提出日時 2022-10-19 19:57:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 225 ms / 1,000 ms
コード長 391 bytes
コンパイル時間 136 ms
コンパイル使用メモリ 10,704 KB
実行使用メモリ 45,116 KB
最終ジャッジ日時 2023-09-12 08:28:49
合計ジャッジ時間 10,990 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 219 ms
44,980 KB
testcase_01 AC 219 ms
44,972 KB
testcase_02 AC 220 ms
45,060 KB
testcase_03 AC 220 ms
45,044 KB
testcase_04 AC 220 ms
45,072 KB
testcase_05 AC 218 ms
44,968 KB
testcase_06 AC 221 ms
45,116 KB
testcase_07 AC 220 ms
44,932 KB
testcase_08 AC 223 ms
45,116 KB
testcase_09 AC 221 ms
44,972 KB
testcase_10 AC 216 ms
45,092 KB
testcase_11 AC 220 ms
45,100 KB
testcase_12 AC 217 ms
44,936 KB
testcase_13 AC 216 ms
44,976 KB
testcase_14 AC 223 ms
44,972 KB
testcase_15 AC 220 ms
45,032 KB
testcase_16 AC 225 ms
45,036 KB
testcase_17 AC 219 ms
44,984 KB
testcase_18 AC 220 ms
44,948 KB
testcase_19 AC 221 ms
45,020 KB
testcase_20 AC 221 ms
44,904 KB
testcase_21 AC 216 ms
44,944 KB
testcase_22 AC 216 ms
45,088 KB
testcase_23 AC 223 ms
45,060 KB
testcase_24 AC 221 ms
45,024 KB
testcase_25 AC 219 ms
45,004 KB
testcase_26 AC 220 ms
44,932 KB
testcase_27 AC 220 ms
45,068 KB
testcase_28 AC 217 ms
44,928 KB
testcase_29 AC 219 ms
45,020 KB
testcase_30 AC 217 ms
45,036 KB
testcase_31 AC 219 ms
45,004 KB
testcase_32 AC 216 ms
44,952 KB
testcase_33 AC 219 ms
45,012 KB
testcase_34 AC 217 ms
45,036 KB
testcase_35 AC 218 ms
45,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from scipy.special import comb


def main():
    x = int(input())

    if x > 31:
        print(0, 0)
        return

    if x == 0:
        print(1, 0)
        return

    patterns = comb(31, x, exact=True)
    if x == 1 or x == 31:
        sum_ = 2**31 - 1
    else:
        sum_ = (2**31 - 1) * comb(30, x-1, exact=True)

    print(patterns, sum_)


if __name__ == "__main__":
    main()
0