入门线段树题
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
#define Lson l,m,rt<<1
#define Rson m+1,r,rt<<1|1
int const MAXN = 200010;
int n,m;
struct Tree{
int l,r;
int v;
}tree[MAXN * 4];
inline int Max(int a,int b){
return a>b?a:b;
}
inline void PushUp(int rt){
tree[rt].v = Max(tree[rt<<1].v,tree[rt<<1|1].v);
}
void Build(int l,int r,int rt){
tree[rt].l = l;
tree[rt].r = r;
if(l =......
阅读全文