网站首页
编程语言
数据库
系统相关
其他分享
编程问答
新根
2024-05-25
C126 带权并查集 P1196 [NOI2002] 银河英雄传说
视频链接: P1196[NOI2002]银河英雄传说-洛谷|计算机科学教育新生态(luogu.com.cn)//带权并查集#include<iostream>usingnamespacestd;constintN=30005;intT;intp[N],d[N],siz[N];intfind(intx){if(p[x]==x)returnx;intt=find(p[x