結果

問題 No.2650 [Cherry 6th Tune *] セイジャク
ユーザー Nzt3Nzt3
提出日時 2024-02-24 18:54:54
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 148 ms / 2,500 ms
コード長 918 bytes
コンパイル時間 2,215 ms
コンパイル使用メモリ 211,708 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-02-24 18:55:02
合計ジャッジ時間 7,571 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 33 ms
6,676 KB
testcase_03 AC 15 ms
6,676 KB
testcase_04 AC 87 ms
6,676 KB
testcase_05 AC 68 ms
6,676 KB
testcase_06 AC 36 ms
6,676 KB
testcase_07 AC 67 ms
6,676 KB
testcase_08 AC 24 ms
6,676 KB
testcase_09 AC 142 ms
6,676 KB
testcase_10 AC 128 ms
6,676 KB
testcase_11 AC 130 ms
6,676 KB
testcase_12 AC 133 ms
6,676 KB
testcase_13 AC 132 ms
6,676 KB
testcase_14 AC 137 ms
6,676 KB
testcase_15 AC 148 ms
6,676 KB
testcase_16 AC 95 ms
6,676 KB
testcase_17 AC 91 ms
6,676 KB
testcase_18 AC 95 ms
6,676 KB
testcase_19 AC 93 ms
6,676 KB
testcase_20 AC 99 ms
6,676 KB
testcase_21 AC 97 ms
6,676 KB
testcase_22 AC 105 ms
6,676 KB
testcase_23 AC 90 ms
6,676 KB
testcase_24 AC 85 ms
6,676 KB
testcase_25 AC 79 ms
6,676 KB
testcase_26 AC 93 ms
6,676 KB
testcase_27 AC 93 ms
6,676 KB
testcase_28 AC 82 ms
6,676 KB
testcase_29 AC 85 ms
6,676 KB
testcase_30 AC 97 ms
6,676 KB
testcase_31 AC 101 ms
6,676 KB
testcase_32 AC 58 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

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';
  }
}
0