LCA
文章平均质量分 86
笑着走完自己的路
这个作者很懒,什么都没留下…
展开
-
LCA 转 RMQ算法 【总结】
首先,在你看这个算法之前,要确保你理解了RMQ的 ST 算法。但是不理解没关系啊,提供通道: 点我声明:这是方便我以后复习用的,所以总结不是特别详细。LCA - 最近公共祖先:在有根树中,两个节点u和v的公共祖先中距离最近的那个点。上图理解:如图,我们想要求出LCA(4,7),LCA(8,6),LCA(5,8)。用LCA转R原创 2015-08-08 18:48:28 · 4422 阅读 · 8 评论 -
poj 2763 Housewife Wind 【LCA or 树链剖分】
Housewife WindTime Limit: 4000MS Memory Limit: 65536KTotal Submissions: 7444 Accepted: 1925DescriptionAfter their royal wedding, Jiajia and Wind hid away in XX Vi原创 2015-08-09 00:22:52 · 1149 阅读 · 0 评论 -
hdoj 5452 Minimum Cut 【LCA or 树链剖分】
Minimum CutTime Limit: 3000/2000 MS (Java/Others) Memory Limit: 65535/102400 K (Java/Others)Total Submission(s): 658 Accepted Submission(s): 292Problem DescriptionGiven a simple原创 2015-09-22 17:03:57 · 507 阅读 · 0 评论 -
Codeforces 609E Minimum spanning tree for each edge【MST + LCA倍增】
E. Minimum spanning tree for each edgetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputConnected undirected原创 2015-12-30 16:59:45 · 596 阅读 · 0 评论 -
poj 3417 Network 【LCA】【树中增新边后 求每条树边被环所覆盖的次数】
NetworkTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 4251 Accepted: 1223DescriptionYixght is a manager of the company called SzqNetwork(SN). Now she's原创 2015-08-15 19:15:12 · 871 阅读 · 0 评论 -
zoj 3195 Design the city 【LCA转RMQ】 【求三点最短距离】
Design the cityTime Limit: 1 Second Memory Limit: 32768 KB Cerror is the mayor of city HangZhou. As you may know, the traffic system of this city is so terrible, that there are traffic原创 2015-08-09 12:10:50 · 986 阅读 · 0 评论 -
hdoj 3078 Network 【LCA 转 RMQ】 【记录前驱 求路径上第k大的点权】
NetworkTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 613 Accepted Submission(s): 244Problem DescriptionThe ALPC company is原创 2015-08-09 21:22:08 · 670 阅读 · 0 评论 -
poj 1470 Closest Common Ancestors 【并查集 求根 + 求解每一个节点是多少对(a,b)的LCA】
Closest Common AncestorsTime Limit: 2000MS Memory Limit: 10000KTotal Submissions: 17233 Accepted: 5526DescriptionWrite a program that takes as input a rooted tree原创 2015-08-10 10:01:11 · 562 阅读 · 0 评论 -
poj 1330 Nearest Common Ancestors 【并查集求根 + 裸LCA】 【LCA入门题】
Nearest Common AncestorsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 21733 Accepted: 11380DescriptionA rooted tree is a well-known data structure in原创 2015-08-10 08:41:37 · 450 阅读 · 0 评论 -
poj 1986 Distance Queries 【LCA转RMQ 裸题】【求两点最短距离】
Distance QueriesTime Limit: 2000MS Memory Limit: 30000KTotal Submissions: 10510 Accepted: 3717Case Time Limit: 1000MSDescriptionFarmer John's cows refused t原创 2015-08-10 10:40:29 · 838 阅读 · 0 评论 -
hdoj 2586 How far away ? 【LCA转RMQ入门题】
How far away ?Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8693 Accepted Submission(s): 3044Problem DescriptionThere are原创 2015-08-09 11:05:35 · 780 阅读 · 0 评论 -
hdoj 2874 Connections between cities 【并查集合并森林成一棵树 + LCA转RMQ】
Connections between citiesTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6497 Accepted Submission(s): 1693Problem Descripti原创 2015-08-08 20:14:12 · 710 阅读 · 0 评论 -
poj 3237 Tree 【LCA or 树链剖分】
TreeTime Limit: 5000MS Memory Limit: 131072KTotal Submissions: 6245 Accepted: 1704DescriptionYou are given a tree with N nodes. The tree’s nodes are numbered 1 th原创 2015-09-07 17:58:43 · 611 阅读 · 0 评论