上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 18 下一页

2017年7月17日

poj2396 Budget 有源汇上下界可行流

摘要: /** 题目:poj2396 Budget 链接:http://poj.org/problem?id=2396 题意: 给定一个n*m矩阵,矩阵元素未知。已知第1~n行的元素和,第1~m列的元素和。以及元素的一些数据范围。 求一个可行的矩阵。 思路: 联想到以前没有下届的做法,用一个s连接所有的行节点,容量为该行的和,所有的列节点连接t,容量为该列的和。 所有的行节点连接所有的列节点,容量为无穷... 阅读全文

posted @ 2017-07-17 21:28 hnust_accqx 阅读(190) 评论(0) 推荐(0) 编辑

2017年7月16日

UVA1349 Optimal Bus Route Design 拆点法+最小费用最佳匹配

摘要: /** 题目:UVA1349 Optimal Bus Route Design 链接:https://vjudge.net/problem/UVA-1349 题意:lrj入门经典P375 给n个点(nv有向边。 左边一侧全是u,右边一侧全是v。 u与若干个v有指向关系u->v。 每一个点都扮演着u,v的指向位置关系。指向别的点,被别的点指向,都是唯一性。 对每一个点拆分成两个点,前者指向... 阅读全文

posted @ 2017-07-16 17:40 hnust_accqx 阅读(156) 评论(0) 推荐(0) 编辑

UVA1658 Admiral 拆点法解决结点容量(路径不能有公共点,容量为1的时候) 最小费用最大流

摘要: /** 题目:UVA1658 Admiral 链接:https://vjudge.net/problem/UVA-1658 题意:lrj入门经典P375 求从s到t的两条不相交(除了s和t外,没有公共点)的路径,使得权值和最小。 思路:拆点法。 除了s,t外。把其他点都拆成两个。 例如点A,拆成A和A'。A指向A'连一条容量为1,花费为0的边。 原来指向A的,仍然指向A点。 原来A指向其... 阅读全文

posted @ 2017-07-16 13:57 hnust_accqx 阅读(193) 评论(0) 推荐(0) 编辑

UVA11082 Matrix Decompressing 最大流建模解矩阵,经典

摘要: /** 题目:UVA11082 Matrix Decompressing 链接:https://vjudge.net/problem/UVA-11082 题意:lrj入门经典P374 已知一个矩阵的行数为r,列数为c,前i行的和ai(1 #include #include #include #include #include #include using namespace std; con... 阅读全文

posted @ 2017-07-16 11:21 hnust_accqx 阅读(216) 评论(0) 推荐(0) 编辑

uva753 A Plug for UNIX 网络流最大流

摘要: C - A Plug for UNIX You are in charge of setting up the press room for the inaugural meeting of the United Nations Internet eXecutive (UNIX), which ha 阅读全文

posted @ 2017-07-16 09:55 hnust_accqx 阅读(484) 评论(0) 推荐(0) 编辑

2017年7月15日

hdu1533 Going Home 最小费用最大流 构造源点和汇点

摘要: Going Home Problem Description On a grid map there are n little men and n houses. In each unit time, every little man can move one unit step, either h 阅读全文

posted @ 2017-07-15 17:13 hnust_accqx 阅读(258) 评论(0) 推荐(0) 编辑

poj1273 Drainage Ditches Dinic最大流

摘要: Drainage Ditches Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 76000 Accepted: 29530 Description Every time it rains on Farmer John's fie 阅读全文

posted @ 2017-07-15 10:44 hnust_accqx 阅读(132) 评论(0) 推荐(0) 编辑

2017年5月24日

Editing a Book UVA - 11212 IDA*

摘要: You have n equal-length paragraphs numbered 1 to n . Now you want to arrange them in the order of 1 ; 2 ;:::;n . With the help of a clipboard, you can 阅读全文

posted @ 2017-05-24 16:27 hnust_accqx 阅读(253) 评论(0) 推荐(0) 编辑

埃及分数问题 迭代加深搜索

摘要: /** 题目:埃及分数问题 链接:lrj算法竞赛入门经典P206 题意:在古埃及,人们使用单位分数的和(即 1/a, a是自然数)表示一切有理数。例如,2/3 = 1/2+1/6; 但不允许:2/3 = 1/3 + 1/3; 因为在加数中不允许有相同的。 对一个分数a/b, 表示方法有很多种,其中加数少的比加数多的好,如果加数个数相同,则最小的分数越大越好。 eg: 19/45=1/3 + 1/... 阅读全文

posted @ 2017-05-24 14:10 hnust_accqx 阅读(405) 评论(0) 推荐(0) 编辑

STL next_permutation(a,a+n) 生成一个序列的全排列。满足可重集。

摘要: /** 题目: 链接: 题意: 思路: */ #include #include #include #include #include #include using namespace std; typedef long long LL; const int mod=1e9+7; const int maxn=1e2+5; const double eps = 1e-12; in... 阅读全文

posted @ 2017-05-24 12:36 hnust_accqx 阅读(454) 评论(0) 推荐(0) 编辑

上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 18 下一页

导航