蒟蒻zyk又来发水题题解了。。。
题目链接:http://poj.org/problem?id=2135
题意:无向边的最小费用最大流,注意要另建超级源点和超级汇点,加一条无向边相当于加4条有向边。
#include
#include
#include
#include
#include
#include
#define MAXV 10100
#define MAXE 1000...
分类:
其他好文 时间:
2014-11-14 17:56:52
阅读次数:
186
Rebuilding RoadsTime Limit:1000MSMemory Limit:30000KTotal Submissions:9249Accepted:4198DescriptionThe cows have reconstructed Farmer John's farm, with...
分类:
其他好文 时间:
2014-11-13 20:21:30
阅读次数:
187
A couple of years ago, a new world wide crisis started, leaving many people with economical problems. Some workers of a particular company are trying to ask for an increase in their salaries.
The c...
分类:
其他好文 时间:
2014-11-11 22:56:24
阅读次数:
285
Description“Farm Game” is one of the most popular games in online community. In the community each player has a virtual farm. The farmer can decide to...
分类:
其他好文 时间:
2014-11-10 21:09:14
阅读次数:
224
题目:poj 2135 Farm Tour
题意:给出一个无向图,问从 1 点到 n 点然后又回到一点总共的最短路。
分析:这个题目不读仔细的话可能会当做最短路来做,最短路求出来的不一定是最优的,他是两条分别最短,但不一定是和最短。
我们可以用费用流来很轻易的解决,建边容量为1,费用为边权,然后源点s连 1 ,费用0 ,容量 2 ,n点连接汇点,容量2,费用0,,就可以了。...
分类:
其他好文 时间:
2014-11-10 10:02:42
阅读次数:
257
POJ 2135 Farm Tour
题目链接
题意:给定一个无向图,边有权值,求从1到n再从n到1的最短路
思路:费用流,连边容量为1(注意是无向图),然后源点和1连容量2,n和汇点连容量是2
代码:
#include
#include
#include
#include
#include
using namespace std;
const int M...
分类:
其他好文 时间:
2014-11-06 00:51:30
阅读次数:
296
Language:
Default
Farm Tour
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 11916
Accepted: 4454
Description
When FJ's friends visit him on the farm, h...
分类:
其他好文 时间:
2014-11-05 19:46:12
阅读次数:
122
Speed Reading
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 8431
Accepted: 3935
Description
All K (1 ≤ K ≤ 1,000) of the cows are participating in Farm...
分类:
其他好文 时间:
2014-11-05 14:54:21
阅读次数:
171
http://acm.hdu.edu.cn/showproblem.php?pid=3696
Farm Game
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 62768/32768 K (Java/Others)
Total Submission(s): 598 Accepted Submission(s): ...
分类:
其他好文 时间:
2014-11-05 00:31:13
阅读次数:
119
Roadblocks
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 7760
Accepted: 2848
Description
Bessie has moved to a small farm and sometimes enjoys returnin...
分类:
数据库 时间:
2014-11-04 00:13:56
阅读次数:
271