随笔分类 - ACM--树--DFS序
摘要:推荐一个大佬的视频:here 模板题:P3384 【模板】轻重链剖分 模板: 1 #include <bits/stdc++.h> 2 typedef long long ll; 3 using namespace std; 4 const int maxn = 1e5+5; 5 6 //dfs序可
阅读全文
摘要:Apple Tree (dfs序+线段树) 1 /*dfs+线段树(单点修改+区间查询)*/ 2 #include "iostream" 3 #include "vector" 4 #include "map" 5 #include "cstdio" 6 #include "cstring" 7 8
阅读全文
摘要:转自:https://blog.csdn.net/qq_36368339/article/details/79236467 树通常有多种类型,但其终归是非线性结构,操作起来有时总是那么费时。 例如:POJ 3321给你一棵树,树上每个节点都有1个苹果,然后你对一个节点操作,如果有苹果就拿走,没苹果就
阅读全文