結果

問題 No.3153 probability max K
ユーザー catupper
提出日時 2025-05-20 21:34:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 501 ms / 2,000 ms
コード長 250 bytes
コンパイル時間 351 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 102,272 KB
最終ジャッジ日時 2025-05-20 21:35:10
合計ジャッジ時間 10,960 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353
def inv(x):
  return pow(x,MOD-2,MOD)

N,K = map(int,input().split())
A = list(map(int,input().split()))

def calc(k):
  ans = 1
  for a in A:
    ans *= min(k, a) * inv(a)
    ans %= MOD
  return ans

print((calc(K) - calc(K-1))%MOD)
0