随笔分类 -  ACM_最小生成树

摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1102 1 #include 2 #include 3 #define INF 1001 4 int map[101][101],vis[101],dist[101]; 5 int n; 6 int prim() 7 { 8 int i,j,mincost=0; 9 for(i=1;imap[p][j])28 dist[j]=map[p][j];29 }30 }31 return mincost;32 }33 int main()... 阅读全文
posted @ 2014-03-23 12:40 清风旋叶 阅读(110) 评论(0) 推荐(0)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1863#include#include#includeusing namespace std;int f[105];typedef struct{ int x,y,w;}Edge;Edge edge[5000];int find(int x){ if(f[x]!=x) f[x]=find(f[x]); return f[x];}int cmp(Edge a,Edge b){ return a.w1) printf("?\n"); els... 阅读全文
posted @ 2014-03-23 12:38 清风旋叶 阅读(114) 评论(0) 推荐(0)