摘要: #include<stdlib.h>#include<string.h>#include<stdio.h>#include<math.h>#include<queue>#define MAXN 105using namespace std;int root[MAXN];struct edge{//定义边结构体 int head;//边头 int tail;//边尾 int cost;//花费 friend bool operator< (const edge &e1,const edge &e2){ //定义比较 阅读全文
posted @ 2013-04-28 22:02 kahreman 阅读(210) 评论(0) 推荐(0) 编辑
摘要: #include<stdlib.h>#include<string.h>#include<stdio.h>#include<math.h>#define MAXN 105#define inf 1000000000typedef double elem;elem prim(int n,elem mat[][MAXN]){ elem min[MAXN],ret=0; int v[MAXN],i,j,k; for (i=0;i<n;i++) min[i]=inf,v[i]=0; for (min[j=0]=0;j<n;j++){ for 阅读全文
posted @ 2013-04-28 13:27 kahreman 阅读(197) 评论(0) 推荐(0) 编辑