#include"wall.h"
#include<bits/stdc++.h>
using namespace std;
int treel[8000000],treer[8000000];
void update2(int v,int qd,int qu){
treel[v]=min(qd,max(treel[v],qu));
treer[v]=min(qd,max(treer[v],qu));
}
void push(int v,int l,int r){
if(l!=r){
update2(v<<1,treel[v],treer[v]);
update2((v<<1)+1,treel[v],treer[v]);
}
treel[v]=0;
treer[v]=2e9;
}
void update(int v,int l,int r,int ql,int qr,int qd,int qu){
if(ql<=l&&r<=qr){
update2(v,qd,qu);
return;
}
int mid=(l+r)>>1;
push(v,l,r);
if(ql<=mid)update(v<<1,l,mid,ql,qr,qd,qu);
if(mid<qr)update((v<<1)+1,mid+1,r,ql,qr,qd,qu);
}
void build(int v,int l,int r,int* res){
if(l==r){
res[l]=treel[v];
return;
}
int mid=(l+r)>>1;
push(v,l,r);
build(v<<1,l,mid,res);
build((v<<1)+1,mid+1,r,res);
}
void buildWall(int n,int k,int* type,int* l,int* r,int* h,int* res){
for(int i=0;i<k;i++)update(1,0,n-1,l[i],r[i],type[i]&1?h[i]:0,op[i]&2?h[i]:2e9);
build(1,0,n-1,res);
}
Compilation message
wall.cpp: In function 'void buildWall(int, int, int*, int*, int*, int*, int*)':
wall.cpp:38:67: error: 'op' was not declared in this scope
38 | for(int i=0;i<k;i++)update(1,0,n-1,l[i],r[i],type[i]&1?h[i]:0,op[i]&2?h[i]:2e9);
| ^~