結果

問題 No.2650 [Cherry 6th Tune *] セイジャク
ユーザー Nzt3Nzt3
提出日時 2024-02-24 18:54:35
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 932 bytes
コンパイル時間 3,585 ms
コンパイル使用メモリ 256,704 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-02-24 18:54:45
合計ジャッジ時間 9,446 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/lazysegtree>
using namespace std;
using ll=long long;

int seg_op(int a,int b){
  return 0;
}
int seg_e(){
  return -1;
}
int seg_comp(int f1,int f2){
  return max(f1,f2);
}
int seg_id(){
  return -1;
}
int seg_map(int f,int s){
  return max(f,s);
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N,A;
  cin>>N>>A;
  vector X(N,0);
  for(int &i:X)cin>>i;
  auto X2=X;
  sort(X2.begin(),X2.end());
  X2.erase(unique(X2.begin(),X2.end()),X2.end());
  atcoder::lazy_segtree<int,seg_op,seg_e,int,seg_map,seg_comp,seg_id> seg(X2.size());
  
  int Q;
  cin>>Q;
  for(int t=1;t<=Q;t++){
    int L,R;
    cin>>L>>R;
    R+=1;
    L=lower_bound(X2.begin(),X2.end(),L)-X2.begin();
    R=lower_bound(X2.begin(),X2.end(),R)-X2.begin();
    seg.apply(L,R,t);
  }
  for(int i=0;i<N;i++){
    cout<<seg.get(lower_bound(X2.begin(),X2.end(),X[i])-X2.begin())<<'\n';
  }
  cout<<'\n';
}
0