結果

問題 No.2141 Enumeratest
ユーザー sepa38sepa38
提出日時 2022-12-02 21:35:39
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 509 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 82,524 KB
実行使用メモリ 91,428 KB
最終ジャッジ日時 2024-04-18 05:21:37
合計ジャッジ時間 35,638 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 893 ms
73,728 KB
testcase_01 AC 893 ms
73,600 KB
testcase_02 AC 904 ms
80,512 KB
testcase_03 AC 898 ms
73,728 KB
testcase_04 RE -
testcase_05 AC 902 ms
75,520 KB
testcase_06 AC 896 ms
73,728 KB
testcase_07 AC 897 ms
74,112 KB
testcase_08 AC 893 ms
74,112 KB
testcase_09 AC 892 ms
74,496 KB
testcase_10 AC 895 ms
74,112 KB
testcase_11 AC 895 ms
74,240 KB
testcase_12 AC 895 ms
74,196 KB
testcase_13 AC 899 ms
73,344 KB
testcase_14 AC 898 ms
73,992 KB
testcase_15 AC 894 ms
73,856 KB
testcase_16 AC 901 ms
74,368 KB
testcase_17 AC 909 ms
77,568 KB
testcase_18 AC 916 ms
77,184 KB
testcase_19 AC 910 ms
77,184 KB
testcase_20 AC 908 ms
77,312 KB
testcase_21 AC 912 ms
77,440 KB
testcase_22 AC 910 ms
77,440 KB
testcase_23 AC 905 ms
77,056 KB
testcase_24 AC 924 ms
91,404 KB
testcase_25 AC 904 ms
78,080 KB
testcase_26 AC 916 ms
77,184 KB
testcase_27 AC 909 ms
77,312 KB
testcase_28 AC 914 ms
77,184 KB
testcase_29 AC 910 ms
77,312 KB
testcase_30 AC 912 ms
77,568 KB
testcase_31 AC 915 ms
77,312 KB
testcase_32 AC 908 ms
77,184 KB
testcase_33 AC 907 ms
77,312 KB
testcase_34 AC 930 ms
91,428 KB
testcase_35 AC 902 ms
77,312 KB
testcase_36 AC 931 ms
77,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def cominit(n, mod):
  global fac, finv
  fac = [1] * n
  finv = [1] * n
  for i in range(2, n):
    fac[i] = (fac[i-1] * i) % mod
    finv[i] = (finv[i-1] * pow(i, mod-2, mod)) % mod

def comb(n, k):
  global mod
  if n < k:
    return 0
  if n < 0 or k < 0:
    return 0
  return (fac[n] * finv[n-k] * finv[k]) % mod

mod = 998244353

cominit(10**6, mod)


n, m = map(int, input().split())
ans = 1
k = m
for i in range(n-1):
  ans *= comb(k, m//n+(m%n>i))
  ans %= mod
  k -= m // n + (m % n > i)
print(ans)
0