結果

問題 No.2130 分配方法の数え上げ mod 998244353
ユーザー sepa38sepa38
提出日時 2022-11-25 21:34:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 152 ms / 2,000 ms
コード長 222 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 82,368 KB
実行使用メモリ 75,384 KB
最終ジャッジ日時 2024-04-10 02:47:11
合計ジャッジ時間 3,013 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,544 KB
testcase_01 AC 35 ms
53,480 KB
testcase_02 AC 35 ms
52,064 KB
testcase_03 AC 35 ms
52,432 KB
testcase_04 AC 36 ms
52,280 KB
testcase_05 AC 36 ms
52,432 KB
testcase_06 AC 36 ms
52,224 KB
testcase_07 AC 36 ms
53,080 KB
testcase_08 AC 36 ms
52,676 KB
testcase_09 AC 36 ms
52,124 KB
testcase_10 AC 35 ms
53,356 KB
testcase_11 AC 35 ms
52,600 KB
testcase_12 AC 34 ms
53,036 KB
testcase_13 AC 35 ms
52,444 KB
testcase_14 AC 36 ms
53,080 KB
testcase_15 AC 36 ms
52,404 KB
testcase_16 AC 36 ms
53,636 KB
testcase_17 AC 45 ms
61,464 KB
testcase_18 AC 52 ms
61,704 KB
testcase_19 AC 51 ms
61,584 KB
testcase_20 AC 35 ms
53,020 KB
testcase_21 AC 53 ms
64,008 KB
testcase_22 AC 35 ms
51,956 KB
testcase_23 AC 53 ms
63,064 KB
testcase_24 AC 35 ms
52,836 KB
testcase_25 AC 51 ms
61,796 KB
testcase_26 AC 34 ms
52,408 KB
testcase_27 AC 150 ms
75,384 KB
testcase_28 AC 35 ms
52,516 KB
testcase_29 AC 152 ms
75,256 KB
testcase_30 AC 36 ms
52,136 KB
testcase_31 AC 36 ms
52,736 KB
testcase_32 AC 36 ms
52,428 KB
testcase_33 AC 36 ms
52,680 KB
testcase_34 AC 36 ms
52,268 KB
testcase_35 AC 36 ms
52,208 KB
testcase_36 AC 34 ms
52,428 KB
testcase_37 AC 35 ms
52,180 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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