摘要:
#include #include #include #include using namespace std; const int maxn=2000000; int add[maxn],l[maxn],r[maxn],sum[maxn],b[maxn],a[maxn]; int n,m,len,tot,ans; int cop[maxn]; /*void work(int l,int r... 阅读全文
摘要:
树链剖分 时间!!!! 首先要学会线段树。由于线段树是基本技能,所以不再此过多解释。 树链剖分操作如下 操作1: 格式: 1 x y z 表示将树从x到y结点最短路径上所有节点的值都加上z 操作2: 格式: 2 x y 表示求树从x到y结点最短路径上所有节点的值之和 操作3: 格式: 3 x z 表 阅读全文