LCA
hadis_fukan
这个作者很懒,什么都没留下…
展开
-
poj 1330 Nearest Common Ancestors (LCA)
题意:求两个点的最近公共祖先。1A#include#include#include#include#define maxn 100010using 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 · 584 阅读 · 0 评论 -
hdu 4912 Paths on the tree (LCA+贪心)
题意:有一颗无根树,原创 2014-08-11 16:17:50 · 586 阅读 · 0 评论