結果

問題 No.3153 probability max K
ユーザー moon17
提出日時 2025-05-21 22:13:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 428 ms / 2,000 ms
コード長 201 bytes
コンパイル時間 500 ms
コンパイル使用メモリ 82,088 KB
実行使用メモリ 115,512 KB
最終ジャッジ日時 2025-05-21 22:13:30
合計ジャッジ時間 7,850 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k,*a=map(int,open(0).read().split())
M=998244353
t=1
for i in a:
  if i>=k:
    t*=k*pow(i,M-2,M)
    t%=M
ans=1
for i in a:
  if i>=k-1:
    ans*=(k-1)*pow(i,M-2,M)
    ans%=M
ans=t-ans
print(ans%M)
0