結果

問題 No.3153 probability max K
ユーザー hato336
提出日時 2025-05-20 21:45:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 376 ms / 2,000 ms
コード長 289 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 82,244 KB
実行使用メモリ 102,516 KB
最終ジャッジ日時 2025-05-20 21:45:27
合計ジャッジ時間 6,505 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
a = list(map(int,input().split()))
mod = 998244353

def f(x):
    res = 1
    for i in a:
        if i <= x:
            continue
        else:
            res *= x * pow(i,mod-2,mod) % mod
            res %= mod
    return res

print((f(k) - f(k-1)) % mod)
0