摘要: 题目链接:http://poj.org/problem?id=1611#include #include #include #include #include #include #include #define maxn 30050#define INF 0x3f3f3fusing namespace std;int pa[maxn]; int find(int x){ return x == pa[x] ? x : pa[x] = find(pa[x]);}int main(){ int n,m; while(scanf("%d%d",&n,&m)){ . 阅读全文
posted @ 2013-07-31 21:14 等待最好的两个人 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=3084本题主要在构图上,我采用的是把要保护的房间与源点相连,有intruder的与汇点相连,相对麻烦。#include #include #include #include #include #include #include #define maxn 30#define maxe 5000 using namespace std;const int INF = 0x3f3f3f;struct Edge{ int from,to,cap,flow; int next;};struct Dinic{ int s,t... 阅读全文
posted @ 2013-07-31 16:53 等待最好的两个人 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2609#include #include #include #include #include #include #include #define maxn 450#define maxe 100000 using namespace std;const int INF = 0x3f3f3f;struct Edge{ int from,to,cap,flow; int next;};struct Dinic{ int s,t; int h... 阅读全文
posted @ 2013-07-31 13:52 等待最好的两个人 阅读(123) 评论(0) 推荐(0) 编辑