結果

問題 No.1989 Pairing Multiset
ユーザー nephrologistnephrologist
提出日時 2022-06-25 09:48:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 369 bytes
コンパイル時間 1,186 ms
コンパイル使用メモリ 86,688 KB
実行使用メモリ 75,984 KB
最終ジャッジ日時 2023-08-08 23:41:03
合計ジャッジ時間 2,962 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
75,796 KB
testcase_01 AC 87 ms
75,568 KB
testcase_02 AC 89 ms
75,784 KB
testcase_03 AC 87 ms
75,736 KB
testcase_04 AC 69 ms
71,108 KB
testcase_05 AC 87 ms
75,788 KB
testcase_06 AC 70 ms
71,184 KB
testcase_07 AC 67 ms
71,216 KB
testcase_08 AC 83 ms
75,616 KB
testcase_09 AC 71 ms
75,632 KB
testcase_10 AC 73 ms
75,920 KB
testcase_11 AC 79 ms
75,832 KB
testcase_12 AC 80 ms
75,984 KB
testcase_13 AC 82 ms
75,800 KB
testcase_14 AC 71 ms
75,632 KB
testcase_15 AC 70 ms
75,924 KB
testcase_16 AC 80 ms
75,856 KB
testcase_17 AC 74 ms
75,740 KB
testcase_18 AC 71 ms
71,364 KB
testcase_19 AC 76 ms
75,736 KB
testcase_20 AC 89 ms
75,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = sys.stdin.buffer.readline

n, m = map(int, input().split())
mod = 998244353
bunbo = 1
bunshi = 1
nn = n % mod
mm = m % mod
# ans = n * binom(2 * n + m, 2 * n + 1)
for i in range(2 * n + 1):
    bunbo *= (2 * nn + mm - i) % mod
    bunbo %= mod
    bunshi *= 1 + i
    bunshi %= mod
ans = bunbo * pow(bunshi, mod - 2, mod) % mod * n % mod
print(ans)
0