
倍增
zhhx2001
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
bzoj1787(倍增lca)
easy,只要分三种情况,取最大值即可 #include #include #include #include using namespace std; const int maxn=500009; struct aa { int to,pre; }edge[maxn*2]; int head[maxn],tot; int f[maxn][26],dep[maxn]; int n,m,原创 2016-07-21 16:04:00 · 395 阅读 · 0 评论 -
bzoj3732(同货车运输,倍增lca+最小生成树)
双向边数组要开大一倍 #include #include #include #include #include using namespace std; const int maxn=20009; struct aa { int u,v,dis; bool operator <(const aa &b) const { return dis<b.dis; } }bian[maxn*原创 2016-07-21 15:21:52 · 534 阅读 · 0 评论 -
bzoj1602(倍增裸题)
裸倍增。 #include #include #include #include #include using namespace std; const int N=1005; int n,q; int head[N],tot,fa[N][25],dis[N][25],dep[N]; struct aa { int to,pre,dis; }edge[N*2]; vo原创 2016-09-09 20:07:47 · 538 阅读 · 0 评论