結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,752 KB
testcase_01 AC 25 ms
10,752 KB
testcase_02 WA -
testcase_03 AC 28 ms
10,880 KB
testcase_04 AC 878 ms
10,880 KB
testcase_05 AC 548 ms
10,752 KB
testcase_06 AC 25 ms
10,752 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 25 ms
10,880 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 572 ms
10,752 KB
testcase_18 AC 564 ms
10,880 KB
testcase_19 AC 745 ms
10,880 KB
testcase_20 AC 535 ms
10,880 KB
testcase_21 AC 618 ms
10,752 KB
testcase_22 AC 422 ms
10,752 KB
testcase_23 AC 252 ms
10,752 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 508 ms
10,752 KB
testcase_27 AC 562 ms
10,752 KB
testcase_28 AC 644 ms
10,752 KB
testcase_29 AC 381 ms
10,880 KB
testcase_30 AC 755 ms
10,752 KB
testcase_31 AC 506 ms
10,880 KB
testcase_32 AC 617 ms
10,752 KB
testcase_33 AC 470 ms
10,752 KB
testcase_34 AC 555 ms
10,752 KB
testcase_35 AC 70 ms
10,752 KB
testcase_36 AC 636 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353

def comb(n, m):
    if m > n - m:
        return comb(n, 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