{POJ}{2421}{Constructing Roads}{Prim}
摘要:
基本MST思路#include<iostream>using namespace std;#define MAX 10000#define INF 999999int g[MAX][MAX],visit[MAX],dist[MAX];int nv,ne,sum;int prim(){ int i,j,tmp,mark_pos,mark_min; sum = 0; for(i = 1;i<=nv;++i) { dist[i] = INF; visit[i] = 0; } dist[1] = 0; for(i=1;i<=nv;++i) { mark_min = INF; f 阅读全文
posted @ 2012-05-17 09:45 Lvpengms 阅读(264) 评论(0) 推荐(0) 编辑