摘要: 图论 虚树 对 dfn 排序,然后在中间插入两两 lca,再排序去重。最后求出再求两两 lca 连边。注意第一个点不连。 void build(){ tot=0; sort(h+1,h+1+m,cmp); for(int i=1;i<m;i++){ int Lca=lca(h[i],h[i+1]); 阅读全文
posted @ 2024-01-12 21:57 Mirasycle 阅读(8) 评论(0) 推荐(0) 编辑