結果

問題 No.3851 Dreams
コンテスト
ユーザー kidodesu
提出日時 2026-12-04 21:53:25
言語 PyPy3
(8.0.1 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 929 ms / 2,000 ms
+ 181µs
コード長 525 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 91 ms
コンパイル使用メモリ 64,028 KB
実行使用メモリ 59,720 KB
最終ジャッジ日時 2026-12-04 21:53:38
合計ジャッジ時間 13,464 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

mod = 998244353
def main():
    n, m = list(map(int, input().split()))
    XY = [list(map(int, input().split())) for _ in range(n)]
    XY.sort(key = lambda x: -x[3])
    b100 = pow(100, -1, mod)
    ans = 0
    for t in list(map(int, input().split())):
        now = 1
        for x, y, p, s in XY:
            c = max(0, t//x)-max(0, (t-y)//x)
            nxt = now*pow((100-p)*b100, c, mod)%mod
            ans = (ans + (now-nxt)*s) % mod
            now = nxt
        ans = (ans + now) % mod
    return ans

print(main())
0