結果
| 問題 |
No.2141 Enumeratest
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-04 16:34:06 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 409 bytes |
| コンパイル時間 | 367 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-10-11 19:21:36 |
| 合計ジャッジ時間 | 15,950 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 21 WA * 13 |
ソースコード
mod = 998244353
def comb(n, m):
out = 1
for i in range(m):
out *= n-i
out //= i + 1
out %= mod
return out
n, m = map(int, input().split(" "))
avg = m // n
res = m % n
ans = 1
cnt = 0
for i in range(n - res):
ans *= comb(m - cnt, avg)
ans %= mod
cnt += avg
for i in range(n-res, n):
ans *= comb(m - cnt, avg+1)
ans %= mod
cnt += avg+1
print(ans)