这篇讲讲线段树,个人认为直接上代码配注释好理解。。。 /*线段树:线段树,是一种二叉搜索树。它将一段区间划分为若干单位区间,每一个节点都储存着一个区间。 基本思想:二分 基础操作:建树 单点查询 单点修改 区间查询 区间修改*/ include <stdio.h> include <string.h> include include <math.h> include define N 200005 using namespace std;struct node{ int l,r,w,f;//l,r为区间左右节点,w为区间和 f为懒标记...