![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LCA
life4711
这个作者很懒,什么都没留下…
展开
-
hdu 2586 LCA模板题(离线和在线两种解法)
http://acm.hdu.edu.cn/showproblem.php?pid=2586 Problem Description There 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 · 4435 阅读 · 0 评论 -
hdu2460&&poj3694 缩点+lca变形
http://acm.hdu.edu.cn/showproblem.php?pid=2460 http://poj.org/problem?id=3694 Problem Description A network administrator manages a large network. The network consists of N computers and M原创 2015-03-02 11:58:35 · 815 阅读 · 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 · 1319 阅读 · 0 评论 -
hdu5452 || 沈阳网络赛1003题 最近公共祖先问题
http://acm.hdu.edu.cn/showproblem.php?pid=5452 Problem Description Given 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 · 1259 阅读 · 0 评论