摘要: int LCA(int x,int y) { if(dep[x]<dep[y]) swap(x,y); for(int i=20;i>=0;i--) if(dep[f[x][i]]>=dep[y]) x=f[x][i]; if(x==y) return x; for(int i=20;i>=0;i- 阅读全文
posted @ 2022-02-12 08:36 fervency 阅读(6) 评论(0) 推荐(0) 编辑