結果

問題 No.3851 Dreams
コンテスト
ユーザー yuunegi
提出日時 2026-12-04 23:00:01
言語 C++23
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 701 ms / 2,000 ms
+ 764µs
コード長 702 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,871 ms
コンパイル使用メモリ 385,872 KB
実行使用メモリ 9,904 KB
最終ジャッジ日時 2026-12-04 23:00:19
合計ジャッジ時間 17,246 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
#if __has_include("all.hpp")
#include "all.hpp"
#else
#include <atcoder/all>
#endif
using namespace atcoder;
using mint=modint998244353;
int main(void){
    int n,m;
    cin>>n>>m;
    vector<array<long long,4>>v(n);
    for(int i=0;i<n;i++)cin>>v[i][1]>>v[i][2]>>v[i][3]>>v[i][0];
    sort(v.rbegin(),v.rend());
    mint ans=0;
    while(m--){
        long long t;
        cin>>t;
        mint p=1;
        for(auto [s, x, y,p2] : v){
            long long tmp=t/x-max(0LL,t-y)/x;
            mint tp=p*(1-((mint)(100-p2)/100).pow(tmp));
            ans+=s*tp;
            p-=tp;
        }
        ans+=p;
    }
    cout<<ans.val()<<endl;
    return 0;
}
0