题目描述
![[HNOI2006]公路修建问题 BZOJ1196 Kruskal_i++](https://file.cfanz.cn/uploads/png/2022/05/27/12/4bCKHGM8aa.png)
输入输出格式
输入格式:
![[HNOI2006]公路修建问题 BZOJ1196 Kruskal_#include_02](https://file.cfanz.cn/uploads/png/2022/05/27/12/8cY8333GEb.png)
![[HNOI2006]公路修建问题 BZOJ1196 Kruskal_#include_03](https://file.cfanz.cn/uploads/png/2022/05/27/12/3T5fDfcY2Z.png)
在实际评测时,将只会有m-1行公路
输出格式:
![[HNOI2006]公路修建问题 BZOJ1196 Kruskal_i++_04](https://file.cfanz.cn/uploads/png/2022/05/27/12/246O62Bbe1.png)
输入输出样例
输入样例#1:
复制
4 2 5
1 2 6 5
1 3 3 1
2 3 9 4
2 4 6 1
输出样例#1: 复制
6
1 1
2 1
4 1
样例貌似有点问题;
其实就是按照贪心从小到大排序就行了;
坑点就是取的maxx要一直维护(可能出现有的2级道路花费>1级道路)
#include
#include
#include
#include
#include
#include
#include
#include
EPFL - Fighting