![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LCA
hadis_fukan
这个作者很懒,什么都没留下…
展开
-
poj 1330 Nearest Common Ancestors (LCA)
题意:求两个点的最近公共祖先。 1A#include #include #include #include #define maxn 100010 using namespace std; int fa[maxn],lev[maxn],pre[maxn],c1,c2; vector son[maxn]; bool dfs(int rt,int obj) { for(int i原创 2014-08-10 15:22:30 · 585 阅读 · 0 评论 -
hdu 4912 Paths on the tree (LCA+贪心)
题意: 有一颗无根树,原创 2014-08-11 16:17:50 · 592 阅读 · 0 评论