結果

問題 No.2141 Enumeratest
ユーザー kawa-yokawa-yo
提出日時 2022-12-04 16:34:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 409 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-20 00:22:38
合計ジャッジ時間 14,283 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,752 KB
testcase_01 AC 25 ms
10,752 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 841 ms
10,752 KB
testcase_05 AC 498 ms
10,880 KB
testcase_06 AC 26 ms
10,752 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 533 ms
10,880 KB
testcase_18 AC 536 ms
10,752 KB
testcase_19 AC 721 ms
10,880 KB
testcase_20 AC 519 ms
10,752 KB
testcase_21 AC 569 ms
10,880 KB
testcase_22 AC 407 ms
10,752 KB
testcase_23 AC 235 ms
10,752 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 484 ms
10,752 KB
testcase_27 AC 531 ms
10,880 KB
testcase_28 AC 647 ms
10,752 KB
testcase_29 AC 350 ms
10,752 KB
testcase_30 AC 701 ms
10,752 KB
testcase_31 AC 493 ms
10,880 KB
testcase_32 AC 596 ms
10,752 KB
testcase_33 AC 472 ms
10,752 KB
testcase_34 AC 536 ms
10,752 KB
testcase_35 AC 74 ms
10,752 KB
testcase_36 AC 607 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0