
图论_LCA
SCUT_Pein
这个作者很懒,什么都没留下…
展开
-
POJ1330--Nearest Common Ancestors
DescriptionA 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原创 2013-07-22 16:29:22 · 677 阅读 · 0 评论 -
POJ1470--Closest Common Ancestors
DescriptionWrite 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 clo原创 2013-07-23 07:27:59 · 747 阅读 · 0 评论 -
POJ1986--Distance Queries
DescriptionFarmer 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 i原创 2013-07-22 21:51:39 · 940 阅读 · 0 评论 -
POJ3694--Network
DescriptionA network administrator manages a large network. The network consists of N computers and M links between pairs of computers. Any pair of computers are connected directly or indirectly原创 2013-07-23 09:19:10 · 810 阅读 · 0 评论 -
SPOJ10628--COT(树上第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 wei原创 2014-04-17 16:32:18 · 998 阅读 · 0 评论 -
LCA模板
一:Tarjan离线求LCA原创 2014-07-16 21:17:25 · 678 阅读 · 0 评论