![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LCA
qq_37383726
这个作者很懒,什么都没留下…
展开
-
LCA 转 RMQ算法 【知识点】
知识点 一原创 2017-05-25 20:55:09 · 273 阅读 · 0 评论 -
【HDU - 4757】Tree 【LCA+持久化01 Trie】
Zero and One are good friends who always have fun with each other. This time, they decide to do something on a tree which is a kind of graph that there is only one path from node to node. First, Zero w原创 2017-11-02 00:15:58 · 274 阅读 · 0 评论 -
tarjan算法 离线求LCA
模板连接 知识点连接 时间复杂度为 o(N+2*Q)原创 2017-06-10 11:21:14 · 207 阅读 · 0 评论 -
Distance Queries 【LCA倍增 求最短路】
Farmer John’s cows refused to run in his marathon since he chose a path much too long for their leisurely lifestyle. He therefore wants to find a path of a more reasonable length. The input to this pro原创 2017-06-09 16:30:46 · 354 阅读 · 0 评论 -
qwb与学姐 【MST】+【倍增求lca 同时维护距离】
Problem H: qwb与学姐 Time Limit: 1 Sec Memory Limit: 128 MB Submit: 113 Solved: 44 [Submit][Status][Web Board] Description qwb打算向学姐表白,可是学姐已经受够了他的骚扰,于是出了一个题想难住他: 已知一幅n个点m条边的无向图,定义路径的值为这条路径上最短的边原创 2017-06-03 20:44:46 · 332 阅读 · 0 评论 -
Nearest Common Ancestors 【并查集找根节点】+【步近法在线求lca】or【LCA转RMQ】
Description A rooted tree is a well-known data structure in computer science and engineering. An example is shown below: In the figure, each node is labeled with an integer from {1, 2,…,16}. Node原创 2017-05-28 08:28:49 · 345 阅读 · 0 评论 -
Housewife Wind 【LCA转RMQ 求最短路+边权修改】or 【树链剖分】
After their royal wedding, Jiajia and Wind hid away in XX Village, to enjoy their ordinary happy life. People in XX Village lived in beautiful huts. There are some pairs of huts connected by bidirectio原创 2017-05-28 11:44:58 · 465 阅读 · 0 评论 -
Closest Common Ancestors 【LCA转RMQ】
Write a program that takes as input a rooted tree and a list of pairs of vertices. For each pair (u,v) the program determines the closest common ancestor of u and v in the tree. The closest common ance原创 2017-05-28 09:03:02 · 220 阅读 · 0 评论 -
谭松松的旅游计划 【LCA 求最短路】
谭松松是一个爱旅游的人,他非常的热爱旅游,即便身体被掏空也要坚持旅游。喵蛤王国由N个城市组成,由N-1条道路连通,每条道路长度为ci,使得任意两座城市都能相互到达。谭松松有M个旅游计划,每个旅游计划有一个起点ai,一个终点bi,所以谭松松想知道,对于每个旅游计划,从起点到终点的最短路长度为多少?Input 第一行两个整数N(2≤N≤100000,),M(1≤M≤100000),表示城市个数,谭松松原创 2017-04-28 22:27:24 · 591 阅读 · 0 评论 -
【SPOJ - COT】Count on a tree 【主席树 求静态树上第k大】
You are given a tree with N nodes. The tree nodes are numbered from 1 to N. Each node has an integer weight.We will ask you to perform the following operation:u v k : ask for the kth minimum weight on原创 2017-11-02 18:28:14 · 223 阅读 · 0 评论