結果

問題 No.420 mod2漸化式
ユーザー ThetaTheta
提出日時 2022-10-19 19:56:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 391 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 10,764 KB
実行使用メモリ 85,900 KB
最終ジャッジ日時 2023-09-12 08:27:52
合計ジャッジ時間 11,731 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 329 ms
45,012 KB
testcase_01 AC 210 ms
45,084 KB
testcase_02 AC 211 ms
45,028 KB
testcase_03 AC 210 ms
45,056 KB
testcase_04 AC 208 ms
45,172 KB
testcase_05 AC 212 ms
44,996 KB
testcase_06 WA -
testcase_07 AC 215 ms
45,024 KB
testcase_08 AC 209 ms
45,056 KB
testcase_09 AC 212 ms
45,020 KB
testcase_10 AC 215 ms
45,096 KB
testcase_11 AC 213 ms
45,176 KB
testcase_12 AC 214 ms
44,976 KB
testcase_13 AC 217 ms
45,116 KB
testcase_14 AC 216 ms
44,952 KB
testcase_15 AC 218 ms
44,992 KB
testcase_16 AC 216 ms
45,116 KB
testcase_17 AC 216 ms
45,188 KB
testcase_18 AC 215 ms
45,032 KB
testcase_19 AC 217 ms
45,096 KB
testcase_20 AC 216 ms
45,040 KB
testcase_21 AC 214 ms
45,100 KB
testcase_22 AC 213 ms
45,188 KB
testcase_23 AC 226 ms
45,144 KB
testcase_24 AC 213 ms
44,992 KB
testcase_25 AC 214 ms
45,236 KB
testcase_26 AC 217 ms
45,272 KB
testcase_27 AC 211 ms
45,112 KB
testcase_28 AC 215 ms
45,040 KB
testcase_29 AC 213 ms
45,020 KB
testcase_30 AC 213 ms
44,944 KB
testcase_31 AC 218 ms
45,092 KB
testcase_32 AC 240 ms
45,028 KB
testcase_33 AC 214 ms
45,072 KB
testcase_34 AC 215 ms
45,260 KB
testcase_35 AC 213 ms
85,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from scipy.special import comb


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

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

    if x == 0:
        print(0, 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