上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 19 下一页
摘要: 这道题挺难的,在网上见到这段分析:对原矩阵黑白染色1 2 34 5 67 8 9A={1,3,5,7,9}B={2,4,6,8}矩阵中每个点可以取两个值中的任意一个,或者都不取。根据这一个条件,我们可以把一个点拆分成两部分,k,k'。对A集合中的点,k为金蛋,k'为银蛋。B集合中的点,k为银蛋,k'... 阅读全文
posted @ 2014-04-16 16:34 贝尔摩德 阅读(135) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include using namespace std;#define maxn 1000#define INF 100000struct Edge{ int from, to, cap, flow;};int n, m, s, t;vecto... 阅读全文
posted @ 2014-03-31 13:04 贝尔摩德 阅读(122) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include using namespace std;#define maxn 1500#define INF 100000struct Edge{ int from, to, cap, flow;};int n, m, s, t;ve... 阅读全文
posted @ 2014-03-29 16:14 贝尔摩德 阅读(125) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include using namespace std;#define maxn 230#define INF 100000struct Edge{ int from, to, cap, flow;};int n, m, s, t;vector... 阅读全文
posted @ 2014-03-29 16:12 贝尔摩德 阅读(141) 评论(0) 推荐(0) 编辑
摘要: #include #include #define maxn 1001000int id[maxn],p[maxn];bool vis[maxn];int find(int x){ if(p[x]==x) return x; else return p[x]=find(p[x]);}vo... 阅读全文
posted @ 2014-03-28 21:18 贝尔摩德 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 原图中相邻点两两连边,容量为1,源点连接狼的节点,容量为INF,羊的节点连接汇点,容量为INF,这样求最小割就可以了。#include #include #include #include using namespace std;#define maxn 50000#define INF 10000... 阅读全文
posted @ 2014-03-27 12:52 贝尔摩德 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 题意:求一个序列最长上升子序列的长度以及有多少个最长上升子序列。#include #include #include #include using namespace std;#define maxn 10000#define INF 100000struct Edge{ int from, ... 阅读全文
posted @ 2014-03-26 13:36 贝尔摩德 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 题意:在一个网络中求最大流和一条流量最大的路的流量的比值。主要是求最大流量的路,深搜一遍,数组q[ i ]表示从s到i点的最大流量,不断更新即可。#include #include #include #include using namespace std;#define maxn 1500#def... 阅读全文
posted @ 2014-03-26 12:52 贝尔摩德 阅读(171) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std;const int N=500;const int MAXE=20000000;const int inf=10&&d[u]+edge[j].w=k) { ans+=(k... 阅读全文
posted @ 2014-03-24 14:17 贝尔摩德 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 题意 二维空间上有一些点,每个点有一个半径r和频率f,要从某一个点S走到另一个点T,然后再从T回到S。从S到T时,如果两个点表示的圆相交并且第一个点小于第二个点的频率的,那么能从第一个点到第二个点,从T到S时,第一个点的频率要大于第二个点的频率。除了S和T,每个点走后就会消失,问是否存在一种走法。相... 阅读全文
posted @ 2014-03-20 17:32 贝尔摩德 阅读(160) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 19 下一页