結果

問題 No.2130 分配方法の数え上げ mod 998244353
ユーザー roarisroaris
提出日時 2022-11-25 21:24:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 319 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 82,232 KB
実行使用メモリ 63,664 KB
最終ジャッジ日時 2024-04-10 02:33:52
合計ジャッジ時間 3,042 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
54,832 KB
testcase_01 AC 37 ms
53,724 KB
testcase_02 AC 36 ms
55,592 KB
testcase_03 WA -
testcase_04 AC 37 ms
54,676 KB
testcase_05 AC 35 ms
54,252 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 38 ms
53,960 KB
testcase_09 AC 38 ms
54,092 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 37 ms
53,940 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 36 ms
53,984 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 37 ms
54,604 KB
testcase_29 WA -
testcase_30 AC 37 ms
53,784 KB
testcase_31 AC 37 ms
55,460 KB
testcase_32 AC 38 ms
54,228 KB
testcase_33 WA -
testcase_34 AC 38 ms
54,252 KB
testcase_35 AC 38 ms
54,052 KB
testcase_36 AC 38 ms
54,180 KB
testcase_37 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

MOD = 998244353

N = int(input())
M = int(input())

if N<M:
    print(0)
    exit()
    
ans = pow(2, N, MOD)
sub = 1

for i in range(M):
    ans -= sub
    ans %= MOD
    sub *= N-i
    sub %= MOD
    sub *= pow(i, MOD-2, MOD)
    sub %= MOD

print(ans)
0