摘要:
#include#include #include #include using namespace std;int f[10002],num[10002];int find(int x){ return f[x]==x?x:f[x]=find(f[x]);}int main(){ int i,j,n,m,t,k,a,len,b; scanf("%d",&t); while(t--) { scanf("%d%d%d",&n,&m,&k); for(i=0;i#include#includeusing namespace s 阅读全文