
lca
knownothing
这个作者很懒,什么都没留下…
展开
-
hdu 2874 Connections between cities 最近公共祖先lca(离线算法/tarjan算法)
#include #include #include #include #include #include using namespace std; const int maxn=1e4+10; const int maxc=1e6+10; struct node{ int to,w; node(int a=0,int b=0){to=a;w=b;} }; int f[原创 2013-08-31 22:36:14 · 2390 阅读 · 0 评论 -
hdu 2586 How far away ? 最近公共祖先lca 在线算法(倍增法)/离线算法(Tarjan算法)
#pragma comment(linker, "/STACK:1024000000,1024000000") #include #include #include #include #include #include using namespace std; const int maxn=40004; struct node{ int to,w; node(int原创 2013-08-30 16:44:57 · 5177 阅读 · 1 评论