摘要: 树上算法01-倍增LCA/Trie 树-相关算法 定义 任意两个节点之间只有唯一一条路径的无向图 $n$个节点,$n - 1$条边 建树方法 链式前向星(提供边的信息) //存储 struct edge{ int to; int pre; }e[ll]; //加边 void add(int x, int y){ e[++cnt].to 阅读全文
posted @ 2022-03-30 17:54 Pero 阅读(64) 评论(0) 推荐(0) 编辑