这个线段树写起来还算简单 和之前的差不多
单点修改也很简单 用zkw直接改点就行了
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int MAXN = 5e4 , INF =-0xffffff;
struct stnode
{
int l,r,m,s;
void init(int v=INF)
{
l=r=m=s=v;
}
};
inline int max(int a,int b,int c)
{
return max(a,max(b,c));
}
struct zKWSegmentTree
{
stnode st[MAXN<<4];
int sz;
void init(int n)
{
int i,t,end;
......
阅读全文