結果

問題 No.2141 Enumeratest
ユーザー sotanishysotanishy
提出日時 2022-12-02 21:25:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 266 bytes
コンパイル時間 238 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 57,984 KB
最終ジャッジ日時 2024-10-09 22:29:09
合計ジャッジ時間 3,195 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
mod = 998244353

q, r = divmod(M, N)
num = 1
for i in range(1, M+1):
    num = num*i%mod
a1 = 1
for i in range(1, q+1):
    a1 = a1*i%mod
a2 = a1*(q+1)%mod


ans = num*pow(pow(a1, N-r, mod)*pow(a2, r, mod), mod-2, mod)%mod
print(ans)
0