摘要: POJ.1287 Networking (Prim)题意分析可能有重边,注意选择最小的边。编号依旧从1开始。直接跑prim即可。代码总览#include #include #define nmax 105#define inf 1e8+7using namespace std;int... 阅读全文
posted @ 2017-07-10 21:55 pengwill 阅读(94) 评论(0) 推荐(0) 编辑
摘要: HDU.1233 还是畅通工程(Prim)题意分析首先给出n,代表村庄的个数然后出n*(n-1)/2个信息,每个信息包括村庄的起点,终点,距离,要求求出最小生成树的权值之和。注意村庄的编号从1开始即可直接跑prim代码总览#include #define nmax 105#defin... 阅读全文
posted @ 2017-07-10 20:42 pengwill 阅读(93) 评论(0) 推荐(0) 编辑