摘要: 最小生成树入门题,和纯粹的裸题有些区别,题目中有些道路已经存在,不需要建造,答案是求最后建造的总费用,不要把已经有的道路的权值算进去//kruskal算法已有的边权植赋为0//用SORT排序,用并查集判断是否成环#include <stdio.h>#include <string.h>#include <algorithm>using namespace std;#define INF 1236343242#define MAX 110bool vis[MAX][MAX];int p[MAX];int ans[MAX*MAX];struct edge{ in 阅读全文
posted @ 2012-10-10 23:42 Titanium 阅读(303) 评论(0) 推荐(0) 编辑