@[juruohcy](/space/show?uid=47374)
```cpp
sort(e + 1, e + m + 1, cmp);
```
m条边
kruskal是对边排序
by Delta_Rain @ 2018-09-01 09:57:42
哈哈,跟我上次考试时错的一样(血泪)
by ThinkofBlank @ 2018-09-01 10:04:38
@[ThinkofBlank](/space/show?uid=81847) 这个我看出来了。。但是改了还是全wa
by Av_alon_ @ 2018-09-01 10:40:22
@[g7DAsxNz2](/space/show?uid=52082) 改了也不对……
by Av_alon_ @ 2018-09-01 10:40:38
```
//这里要加括号
if(fu != fv){
fa[fu]=fv;
ans+=val,cnt++;
}
```
by command_block @ 2018-09-01 10:46:33
@[juruohcy](/space/show?uid=47374)
by command_block @ 2018-09-01 10:47:02
if(fu != fv)
fa[fu]=fv;
ans+=val,cnt++;
by ThinkofBlank @ 2018-09-01 10:48:18
尬了。。。
by ThinkofBlank @ 2018-09-01 10:48:33
@[juruohcy](/space/show?uid=47374)
这。。滑稽,不过建议用`Prim`算法。
by Delta_Rain @ 2018-09-01 15:48:19
@[ThinkofBlank](/space/show?uid=81847) 谢谢大佬。。
by Av_alon_ @ 2018-09-01 16:35:22