摘要: 树链剖分+BIT - FZU 2082 - 过路费 核心思路: 边权转化为点权:树上某一条边可以唯一转化为子节点的点权 BIT维护单点修改+区间查询 注意本题有多组输入,每组样例需要重新init #include <cstdio> #include <vector> #include <cstdli 阅读全文
posted @ 2021-03-02 21:33 popozyl 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 树链剖分 - AcWing 918 - 软件包管理器 这道题也挺板的,线段树的lazy维护区间置数即可。 #include <bits/stdc++.h> using namespace std; const int N = 1e5+5, M = N<<2; int n, m; int a, b, 阅读全文
posted @ 2021-03-02 12:01 popozyl 阅读(40) 评论(0) 推荐(0) 编辑