結果

問題 No.2130 分配方法の数え上げ mod 998244353
ユーザー shobonvipshobonvip
提出日時 2022-11-25 21:26:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 82,092 KB
実行使用メモリ 72,732 KB
最終ジャッジ日時 2024-04-10 02:36:02
合計ジャッジ時間 2,801 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,904 KB
testcase_01 AC 34 ms
52,188 KB
testcase_02 AC 33 ms
52,124 KB
testcase_03 AC 34 ms
52,320 KB
testcase_04 AC 35 ms
52,304 KB
testcase_05 AC 34 ms
52,820 KB
testcase_06 AC 36 ms
52,372 KB
testcase_07 AC 35 ms
51,984 KB
testcase_08 AC 34 ms
52,064 KB
testcase_09 AC 34 ms
52,000 KB
testcase_10 AC 34 ms
52,472 KB
testcase_11 AC 33 ms
52,816 KB
testcase_12 AC 33 ms
52,352 KB
testcase_13 AC 33 ms
52,316 KB
testcase_14 AC 33 ms
52,872 KB
testcase_15 AC 35 ms
53,112 KB
testcase_16 AC 35 ms
52,428 KB
testcase_17 AC 43 ms
60,624 KB
testcase_18 AC 48 ms
60,044 KB
testcase_19 AC 49 ms
60,948 KB
testcase_20 AC 34 ms
53,036 KB
testcase_21 AC 51 ms
61,716 KB
testcase_22 AC 33 ms
53,180 KB
testcase_23 AC 51 ms
61,388 KB
testcase_24 AC 35 ms
52,252 KB
testcase_25 AC 51 ms
62,168 KB
testcase_26 AC 34 ms
52,876 KB
testcase_27 AC 140 ms
72,348 KB
testcase_28 AC 35 ms
53,244 KB
testcase_29 AC 142 ms
72,732 KB
testcase_30 AC 33 ms
51,960 KB
testcase_31 AC 33 ms
51,872 KB
testcase_32 AC 32 ms
52,480 KB
testcase_33 AC 33 ms
52,556 KB
testcase_34 AC 33 ms
53,416 KB
testcase_35 AC 32 ms
52,440 KB
testcase_36 AC 32 ms
52,856 KB
testcase_37 AC 33 ms
53,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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