結果

問題 No.2130 分配方法の数え上げ mod 998244353
ユーザー lloyzlloyz
提出日時 2022-11-25 21:30:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 149 ms / 2,000 ms
コード長 249 bytes
コンパイル時間 228 ms
コンパイル使用メモリ 82,420 KB
実行使用メモリ 75,748 KB
最終ジャッジ日時 2024-04-10 02:41:21
合計ジャッジ時間 2,971 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,356 KB
testcase_01 AC 35 ms
52,128 KB
testcase_02 AC 36 ms
52,276 KB
testcase_03 AC 36 ms
53,096 KB
testcase_04 AC 36 ms
52,632 KB
testcase_05 AC 36 ms
53,488 KB
testcase_06 AC 35 ms
54,092 KB
testcase_07 AC 35 ms
53,372 KB
testcase_08 AC 34 ms
52,836 KB
testcase_09 AC 35 ms
52,464 KB
testcase_10 AC 35 ms
53,988 KB
testcase_11 AC 36 ms
52,084 KB
testcase_12 AC 38 ms
52,516 KB
testcase_13 AC 34 ms
52,428 KB
testcase_14 AC 36 ms
52,756 KB
testcase_15 AC 36 ms
52,492 KB
testcase_16 AC 36 ms
52,560 KB
testcase_17 AC 47 ms
60,892 KB
testcase_18 AC 52 ms
63,024 KB
testcase_19 AC 50 ms
60,672 KB
testcase_20 AC 35 ms
52,344 KB
testcase_21 AC 55 ms
62,648 KB
testcase_22 AC 35 ms
52,424 KB
testcase_23 AC 52 ms
62,272 KB
testcase_24 AC 36 ms
52,992 KB
testcase_25 AC 52 ms
62,748 KB
testcase_26 AC 35 ms
52,676 KB
testcase_27 AC 149 ms
75,264 KB
testcase_28 AC 36 ms
52,272 KB
testcase_29 AC 149 ms
75,748 KB
testcase_30 AC 36 ms
52,108 KB
testcase_31 AC 35 ms
52,760 KB
testcase_32 AC 35 ms
52,028 KB
testcase_33 AC 35 ms
52,136 KB
testcase_34 AC 34 ms
52,064 KB
testcase_35 AC 34 ms
52,556 KB
testcase_36 AC 35 ms
52,068 KB
testcase_37 AC 36 ms
51,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
m = int(input())
mod = 998244353

if n < m:
    print(0)
    exit()
ans = pow(2, n, mod) - 1
res = 1
for i in range(1, m):
    res *= n - i + 1
    res *= pow(i, mod - 2, mod)
    res %= mod
    ans -= res
    ans %= mod
print(ans)
0