Lunch Time http://acm.hdu.edu.cn/showproblem.php?pid=4807 Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 782    Accepted Submission(s): 183 Problem Description The campus of Nanjing University…
Coding Contest http://acm.hdu.edu.cn/showproblem.php?pid=5988 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 5337    Accepted Submission(s): 1256 Problem Description A coding contest will be he…
The Windy's Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 5362   Accepted: 2249 Description The Windy's is a world famous toy factory that owns M top-class workshop to make toys. This year the manager receives N orders for toys. The ma…
题意: 1.一个人从[1,1] ->[n,n] ->[1,1] 2.仅仅能走最短路 3.走过的点不能再走 问最大和. 对每一个点拆点限流为1就可以满足3. 费用流流量为2满足1 最大费用流,先给图取负,结果再取负,满足2 #include <stdio.h> #include <string.h> #include <iostream> #include <math.h> #include <queue> #include <s…
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 horizontally, or vertically, to an adjacent point. For each little man, you need to pay a $1 travel fee for every step he moves, unt…
3442: 学习小组 题目:传送门 题解: 超级好题啊大佬们的神题!建图肥肠灵性!感觉自己是星际玩家... 首先呢st直接向每个人连边,容量为min(k,喜欢的小组个数),费用为0 然后每个人再向ed连,因为题目要求人数尽量多,那么每个人都至少要去一个学习小组,那么容量就为min(k-1,喜欢的小组个数-1),费用为0(表示每个人最多能不选的小组) 每个人还要向自己喜欢的小组连边,容量为1,费用就为-F[i](因为题目问的是最小的支出,那么F表示的是手续费,所以肯定为负) 灵性的操作来了: 每个…
题意: n行, a房间的气球,b房间的气球 i行需要的气球,与a房的距离,b房的距离 求最小距离 #include <stdio.h> #include <string.h> #include <iostream> #include <math.h> #include <queue> #include <set> #include <algorithm> #include <stdlib.h> #define…
2055: 80人环游世界 Time Limit: 10 Sec  Memory Limit: 64 MBSubmit: 321  Solved: 201[Submit][Status][Discuss] Description     想必大家都看过成龙大哥的<80天环游世界>,里面的紧张刺激的打斗场面一定给你留下了深刻的印象.现在就有这么     一个80人的团伙,也想来一次环游世界.     他们打算兵分多路,游遍每一个国家.     因为他们主要分布在东方,所以他们只朝西方进军.设从东…
题面:[模板]最小费用最大流 代码: #include<cstdio> #include<cstring> #include<iostream> #include<queue> #define ll long long #define min(a,b) ((a)<(b)?(a):(b)) #define max(a,b) ((a)>(b)?(a):(b)) using namespace std; inline ll rd(){ ll x=,f=…
#include<cstdio> #include<algorithm> #include<cstring> #include<queue> using namespace std; #define MAXN 501 #define MAXM 50001 #define INF 2147483647 int S,T,n,m; int en,u[MAXM],v[MAXM],first[MAXN],next[MAXM],cap[MAXM],cost[MAXM];…