
LCA
life4711
这个作者很懒,什么都没留下…
展开
-
hdu 2586 LCA模板题(离线和在线两种解法)
http://acm.hdu.edu.cn/showproblem.php?pid=2586Problem DescriptionThere are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this原创 2015-03-01 10:51:36 · 4516 阅读 · 0 评论 -
hdu2460&&poj3694 缩点+lca变形
http://acm.hdu.edu.cn/showproblem.php?pid=2460http://poj.org/problem?id=3694Problem DescriptionA network administrator manages a large network. The network consists of N computers and M原创 2015-03-02 11:58:35 · 867 阅读 · 0 评论 -
LCA最近公共祖先 在线算法和离线算法 模板
原理讲解:http://dongxicheng.org/structure/lca-rmq/在线算法模板:/**LCA在线算法O(nlogn)主函数调用:init();tot=0,dir[1]=0;dfs(1,1);ST(2*n-1);int lca=LCA(u,v);*/#include #include #include #include #inclu原创 2015-03-01 17:23:53 · 1396 阅读 · 0 评论 -
hdu5452 || 沈阳网络赛1003题 最近公共祖先问题
http://acm.hdu.edu.cn/showproblem.php?pid=5452Problem DescriptionGiven a simple unweighted graph G (an undirected graph containing no loops nor multiple edges) with n nodes and m edges.原创 2015-09-22 21:05:32 · 1309 阅读 · 0 评论