摘要: 1 #include 2 #include 3 #include 4 #define N 110 5 #define M 5000 6 using namespace std; 7 8 int n, m, u[M], v[M], w[M], r[M], p[N]; 9 bool cmp(int i, int j){ return w[i]> m >> n&&m) 15 ... 阅读全文
posted @ 2017-07-23 19:49 ouyang_wsgwz 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 1 //克鲁斯卡尔 2 #include 3 #include 4 using namespace std; 5 const int maxn = 10005; 6 struct node 7 { 8 int begin, end, len; 9 }cun[maxn]; 10 int n, fa[maxn], ans, m; 11 12 bool cmp(node a... 阅读全文
posted @ 2017-07-23 18:13 ouyang_wsgwz 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 #define MAXN 1005 8 int n, m; 9 int fa[MAXN]; //父节点 10 int mark[MAXN]; 11 12 void init() 13 { 14 for (int ... 阅读全文
posted @ 2017-07-23 17:10 ouyang_wsgwz 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 int G[300][300]; 5 int Prev[300]; //路径上每个节点的前驱节点 6 bool Visited[300]; 7 int n,m; //m是顶点数目,顶点编号从1开始 1是源,m是汇, n是 边数 8 9 int Augment() 10 { ... 阅读全文
posted @ 2017-07-23 16:19 ouyang_wsgwz 阅读(96) 评论(0) 推荐(0) 编辑