結果

問題 No.2130 分配方法の数え上げ mod 998244353
ユーザー hir355hir355
提出日時 2022-11-26 00:12:18
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 184 ms / 2,000 ms
コード長 222 bytes
コンパイル時間 526 ms
コンパイル使用メモリ 87,028 KB
実行使用メモリ 76,484 KB
最終ジャッジ日時 2023-07-25 12:14:09
合計ジャッジ時間 5,737 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,128 KB
testcase_01 AC 74 ms
71,176 KB
testcase_02 AC 74 ms
70,964 KB
testcase_03 AC 77 ms
71,200 KB
testcase_04 AC 72 ms
71,320 KB
testcase_05 AC 72 ms
71,244 KB
testcase_06 AC 71 ms
71,244 KB
testcase_07 AC 73 ms
71,412 KB
testcase_08 AC 74 ms
71,232 KB
testcase_09 AC 71 ms
71,388 KB
testcase_10 AC 73 ms
71,104 KB
testcase_11 AC 74 ms
71,244 KB
testcase_12 AC 74 ms
71,240 KB
testcase_13 AC 75 ms
70,972 KB
testcase_14 AC 74 ms
71,384 KB
testcase_15 AC 75 ms
71,260 KB
testcase_16 AC 74 ms
70,968 KB
testcase_17 AC 82 ms
75,836 KB
testcase_18 AC 90 ms
76,048 KB
testcase_19 AC 89 ms
76,040 KB
testcase_20 AC 73 ms
71,504 KB
testcase_21 AC 94 ms
76,124 KB
testcase_22 AC 75 ms
71,320 KB
testcase_23 AC 90 ms
76,012 KB
testcase_24 AC 74 ms
71,248 KB
testcase_25 AC 90 ms
76,004 KB
testcase_26 AC 74 ms
71,328 KB
testcase_27 AC 182 ms
76,484 KB
testcase_28 AC 76 ms
71,324 KB
testcase_29 AC 184 ms
76,340 KB
testcase_30 AC 75 ms
71,276 KB
testcase_31 AC 75 ms
71,344 KB
testcase_32 AC 74 ms
71,264 KB
testcase_33 AC 75 ms
71,180 KB
testcase_34 AC 73 ms
71,144 KB
testcase_35 AC 74 ms
71,192 KB
testcase_36 AC 76 ms
71,376 KB
testcase_37 AC 73 ms
71,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353
n = int(input())
m = int(input())
if n < m:
    print(0)
    exit(0)
ans = pow(2, n, MOD)
c = 1
for i in range(m):
    ans -= c
    c *= n - i
    c *= pow(i + 1, MOD - 2, MOD)
    c %= MOD
print(ans % MOD)
0