LCA
文章平均质量分 76
Rogershy
选择不逃避,就是选择成长。github项目地址:https://github.com/sunhuanyao/
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
poj 1986 Distance Queries
分析:LCA的入门题吧,求两个点的距离。 #include #include #include #include using namespace std; const int maxn = 100500; struct Node{ int v,next,w; }e[maxn]; struct trd{ int v,now; trd(int a=0,int b=0){原创 2013-10-29 18:11:10 · 506 阅读 · 0 评论 -
POJ上的LCA问题小节(转)
1330和1470是入门系列,可以说基本上时用来测试板子的 1986比上面两个稍微多了一个距离,但是本质还是一样的对于一个询问d[u,v]=dis[u]+dis[v]-dis[LCA(u,v)] 可以一边LCA一边动态修改当前点到根的距离 3728其实就是记录的东西多了一点(1)孩子到父亲最大价格(2)孩子到父亲最小价格(3)从自己到祖先的最大收益 (4)从祖先到自己的最大收转载 2013-10-31 22:58:53 · 533 阅读 · 0 评论 -
poj 3694 Network
分析:先缩点成树,然后模拟LCA过程。 #include #include #include #include using namespace std; const int maxn = 200500; //const int maxm = 405000; struct Node{ int v,next; }e[maxn*4],tree[maxn*4]; int bridge,vis原创 2013-11-01 20:24:38 · 493 阅读 · 0 评论
分享