Greater than the first number of the subscript x is equal to the demand interval

int tree[4*N];
void build(int o,int l,int r) {
    if(l==r) {cin>>tree[o];return;}
    build(ls,l,mid);
    build(rs,mid+1,r);
    tree[o] = max(tree[ls],tree[rs]);
}
int get(int o, int l, int r, int x) {
    if (l == r) return l;
    return tree[ls] > x ? get(LS, L, MID, X): GET (RS, MID + . 1 , R & lt, X); 
} 
int Query ( int O, int L, int R & lt, int QL, int QR, int X) { // Query [QL , qr] is greater than the first number of position x of the 
    IF (QR <|| R & lt L <QL) return - . 1 ;
     IF (QL <= R & lt && L <= QR) return ? Tree [O]> x GET ( O, L, R & lt, X): - . 1 ;
     int T = Query (LS, L, MID, QL, QR, X);
     return T = -! . 1 ? t : query(rs, mid+1, r, ql, qr, x);
}

 

Guess you like

Origin www.cnblogs.com/zxz666/p/11402720.html