The Exchange of Items
Time Limit: 2 Seconds
Memory Limit: 65536 KB
Bob lives in an ancient village, where transactions are done by one item exchange with another. Bob is very clever an...
分类:
其他好文 时间:
2015-08-29 00:48:48
阅读次数:
192
Cyclic Tour
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/65535 K (Java/Others)
Total Submission(s): 1950 Accepted Submission(s): 984
Problem Description
There are N cities ...
分类:
其他好文 时间:
2015-08-28 02:13:01
阅读次数:
162
Going Home
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 3452 Accepted Submission(s): 1771
Problem Description
On a grid map ther...
分类:
其他好文 时间:
2015-08-28 00:52:29
阅读次数:
167
Tour
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)
Total Submission(s): 2308 Accepted Submission(s): 1156
Problem Description
In the kingdom of Henryy,...
分类:
其他好文 时间:
2015-08-28 00:50:06
阅读次数:
486
The Exchange of Items
Time Limit: 2 Seconds Memory Limit: 65536 KB
Bob lives in an ancient village, where transactions are done by one item exchange with another. Bob is very clever and he...
分类:
其他好文 时间:
2015-08-27 02:16:40
阅读次数:
225
每个物品分开做最小费用最大流。#include#include#include#include#include#includeusing namespace std;const int maxn=1000+10;const int INF=0x7FFFFFFF;struct Edge{ int...
分类:
其他好文 时间:
2015-08-19 09:19:48
阅读次数:
124
拆点,每个点拆成 i,i'在i 和i‘之间连一条费用为0,容量为1的边,就可以保证每个点只经过一次特殊的点,1和n之间,,,n和2*n之间连一条费用为0,容量为2的边,可以求出两条路径 1 #include 2 #include 3 #include 4 #include 5 #inclu...
分类:
其他好文 时间:
2015-08-17 21:36:04
阅读次数:
132
题目链接:
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1687题意:给你n个城市到m个海港的距离,求每个城市都有船只去的最短平均航行距离。源点向城市建边 城市向海港 海港向汇点建边 容量为1,最后城市向海港的费用为距离代码:#include<stdi...
分类:
其他好文 时间:
2015-08-16 13:50:09
阅读次数:
166
传送门:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3885
题意:有n件物品,告诉你最初第i件物品的数量Ai,要求最后数量变成Bi
然后有m种交换方式,每种交换方式有两个数字a b,表示物品a能和b等价交换,是双向的
求最少交换多少次,就能实现
这题的正解是套用最小费用最大流模板。。
对着模板...
分类:
其他好文 时间:
2015-08-16 00:42:02
阅读次数:
112
第一道费用流的题目---其实---还是不是很懂,只知道沿着最短路找增广路建图源点到1连一条容量为2(因为要来回),费用为0的边n到汇点连一条容量为2,费用为0的边另外的就是题目中输入的了另外这题是无向边-----maxn 开到1000会re----存个模板先吧--------------------...
分类:
其他好文 时间:
2015-08-14 21:11:43
阅读次数:
140