摘要: 倍增发: 快速求祖先 代码 void dfs1(int u,int f) { fa[u]=f; vis[u]=1; dep[u]=dep[f]+1; for(ri i=1;(1<<i)<=dep[u];i++) anc[u][i]=anc[anc[u][i-1]][i-1]; for(ri i=he 阅读全文
posted @ 2019-10-29 18:24 VxiaohuanV 阅读(156) 评论(0) 推荐(0)