2011年8月12日

ACM PKU 1273 Drainage Ditches

摘要: 题目描述: http://poj.org/problem?id=1273第一道最大网络流算法题,也是跟着老师写的 1 #include <iostream> 2 using namespace std; 3 #define MAX 100000000 4 #define MAXN 205 5 6 int pre[MAXN+10],prem[MAXN+10]; 7 int ecnt,box[MAXN]; 8 9 struct node10 {11 int to,next,w;12 }edge[MAXN*2];13 14 void make_map(int from,int to,in 阅读全文

posted @ 2011-08-12 19:05 _Clarence 阅读(134) 评论(0) 推荐(0) 编辑

ACM PKU 1325 Machine Schedule http://poj.org/problem?id=1325

摘要: 第一个二分图的题目,匈牙利算法,跟着老师做完了,展示老师的代码,威武,哈哈 1 #include <iostream> 2 #include <stdio.h> 3 #include <string.h> 4 using namespace std; 5 const int maxn=105; 6 7 bool flag[maxn]; 8 int match[maxn]; 9 int map[maxn][maxn];10 11 int N,M,K;12 13 bool xyy(int s)14 {15 for(int i=0; i<M; i++)16 阅读全文

posted @ 2011-08-12 19:03 _Clarence 阅读(134) 评论(0) 推荐(0) 编辑

ACM PKU 3723 Conscription http://poj.org/problem?id=3723

摘要: 一道最大生成树的题,重载一下"<"号就行,因为会存在森林的情况,所以prim算法不好做,kruskal是是解决这道题的神器; 1 #include <stdio.h> 2 #include <iostream> 3 #include <cstring> 4 #include <algorithm> 5 using namespace std; 6 7 const int maxp = 10005; 8 9 const int maxe = 50005;10 11 int N,M,R;12 13 int pre[maxp* 阅读全文

posted @ 2011-08-12 10:45 _Clarence 阅读(203) 评论(0) 推荐(0) 编辑

导航