結果

問題 No.2942 Sigma Music Game Level Problem
ユーザー Facade
提出日時 2025-03-03 11:15:32
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 1,069 bytes
コンパイル時間 6,845 ms
コンパイル使用メモリ 281,876 KB
実行使用メモリ 8,604 KB
最終ジャッジ日時 2025-03-03 11:15:56
合計ジャッジ時間 15,719 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 8 TLE * 1 -- * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#include<atcoder/segtree>
int op(int a,int b){return a+b ;}
int e(){return 0;}
vector<int>change;
int main(){
    int n,q,l0;cin>>n>>q>>l0;
    int cnt=0;
    multiset<int>lst;
    for(int i=0;i<n;i++){
        int num;cin>>num;
        lst.insert(num);
    }
    for(int i=0;i<q;i++){
        int type;cin>>type;
        if(type==3){
            int m;cin>>m;
        }
        else if(type==1){
            int ll;cin>>ll;
            lst.insert(ll);
        }
        else{
            int left,right;cin>>left>>right;
            cnt++;
            change.clear();
            for(auto ite=lst.begin();ite!=lst.end();ite++){
                change.push_back(*ite);
            }
            atcoder::segtree<int,op,e>st(change);
            int ll=lower_bound(change.begin(),change.end(),left)-change.begin();
            int rr=upper_bound(change.begin(),change.end(),right)-change.begin();
            cout<<rr-ll<<" ";
            cout<<st.prod(ll,rr)<<"\n";
        }
    }
    if(cnt==0)cout<<"Not Found!"<<endl;;
}
0