結果

問題 No.2141 Enumeratest
ユーザー 👑 timitimi
提出日時 2022-12-03 18:06:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 301 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 82,436 KB
実行使用メモリ 252,020 KB
最終ジャッジ日時 2024-04-19 04:12:57
合計ジャッジ時間 10,564 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 227 ms
251,508 KB
testcase_01 AC 234 ms
251,644 KB
testcase_02 AC 236 ms
251,764 KB
testcase_03 AC 231 ms
251,508 KB
testcase_04 AC 242 ms
251,372 KB
testcase_05 AC 238 ms
251,512 KB
testcase_06 AC 226 ms
252,020 KB
testcase_07 AC 227 ms
251,376 KB
testcase_08 AC 225 ms
251,380 KB
testcase_09 AC 232 ms
251,792 KB
testcase_10 AC 225 ms
251,508 KB
testcase_11 AC 230 ms
252,020 KB
testcase_12 AC 228 ms
252,020 KB
testcase_13 AC 226 ms
251,752 KB
testcase_14 AC 225 ms
251,504 KB
testcase_15 AC 228 ms
251,632 KB
testcase_16 AC 228 ms
251,888 KB
testcase_17 AC 239 ms
252,020 KB
testcase_18 AC 244 ms
251,892 KB
testcase_19 AC 301 ms
251,384 KB
testcase_20 AC 238 ms
251,500 KB
testcase_21 AC 235 ms
251,768 KB
testcase_22 AC 237 ms
251,636 KB
testcase_23 AC 234 ms
251,888 KB
testcase_24 AC 248 ms
251,508 KB
testcase_25 AC 238 ms
251,788 KB
testcase_26 AC 242 ms
251,380 KB
testcase_27 AC 243 ms
251,508 KB
testcase_28 AC 242 ms
251,508 KB
testcase_29 AC 244 ms
251,760 KB
testcase_30 AC 241 ms
251,708 KB
testcase_31 AC 235 ms
251,636 KB
testcase_32 AC 241 ms
251,512 KB
testcase_33 AC 252 ms
251,384 KB
testcase_34 AC 258 ms
251,388 KB
testcase_35 AC 245 ms
251,768 KB
testcase_36 AC 239 ms
251,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int, input().split())
mod=998244353
n=10**6+100
inv_t=[0]+[1]
for i in range(2,n):
  inv_t+=[inv_t[mod%i]*(mod-int(mod/i))%mod]

kai=[1,1]
rev_kai=[1,inv_t[1]]
for i in range(2,n):
  kai.append(kai[-1]*i%mod)
  rev_kai.append(rev_kai[-1]*inv_t[i]%mod)

def cmb(n,r):
  return kai[n]*rev_kai[r]*rev_kai[n-r]%mod

ans=1
d=M//N
d+=1
e=M%N
for i in range(N):
  if i==e:
    d-=1
  ans*=cmb(M,d)
  ans%=mod
  M-=d
print(ans)
  
0