@[tiandong123](/space/show?uid=53023) 但也不至于全wa吧TvT
by ʚ卡兔琳娜ɞ @ 2018-10-25 20:35:48
kruskal都打错了 ~~真是丢人啊~~
by dblark @ 2018-10-25 20:37:54
sort加了n,应该加m
by tiandong123 @ 2018-10-25 20:38:41
@[dblark](/space/show?uid=40241) 不不不~~毕竟我是机房最蒟~~
by ʚ卡兔琳娜ɞ @ 2018-10-25 20:39:43
@[dblark](/space/show?uid=40241) dalao不至于这么说别人吧,~~小心掉RP诶-v-~~
by Enquir @ 2018-10-25 20:40:21
亲测$AC$
只要把
```
sort(a+1,a+1+n,cmp)
```
改为
```
sort(a+1,a+1+m,cmp)
```
即可
by tiandong123 @ 2018-10-25 20:41:08
@[katarina0v0](/space/show?uid=114846)
by tiandong123 @ 2018-10-25 20:41:27
@[tiandong123](/space/show?uid=53023) 3Q!!~~真是太丢人了~~
by ʚ卡兔琳娜ɞ @ 2018-10-25 20:42:23
1:并查集要路径压缩
```cpp
int find(int x)
{
if(fa[x]==x) return x;
else
{
fa[x]=sfind(fa[x]);
return fa[x];
}
}
```
2:```输出包含一个数,即最小生成树的各边的长度之和;如果该图不连通则输出orz```
请问你什么时候判断了图不连通呀
by zybnxy @ 2018-10-25 20:43:27
这题数据有点水,没判不联通可以过
by Yae_Sakura @ 2018-10-25 20:44:43