hdu 2122 (prime 最小生成树)

点击打开链接


/*


手生了,WA了一次,

最后才发现用prime比dijk好多了。。。

2013-04-23

*/


#include"stdio.h"
#include"string.h"
#include"stdlib.h"
#include"algorithm"
#define inf 999999999
using namespace std;
int set[1001];
int find(int x)
{
	if(set[x]==x)return x;
	set[x]=find(set[x]);
	return set[x];
}
struct node
{
	int a,b,c;
}A[10001];
int cmp(node a,node b)
{
	return a.c


你可能感兴趣的:(hdu 2122 (prime 最小生成树))