Description The Global Aerial Research Centre has been allotted the task of building the fifth generation of mobile phone nets in Sweden. The most striking reason why they got the job, is their discovery of a new, highly noise resistant, antenna. It…
POJ 1422 Air Raid 题目链接 题意:给定一个有向图,在这个图上的某些点上放伞兵,能够使伞兵能够走到图上全部的点.且每一个点仅仅被一个伞兵走一次.问至少放多少伞兵 思路:二分图的最小路径覆盖,每一个点拆成两个点,然后依据有向边连边,然后答案为n - 最大匹配数 代码: #include <cstdio> #include <cstring> #include <vector> #include <algorithm> using namespa…
UVA 1201 - Taxi Cab Scheme 题目链接 题意:给定一些乘客.每一个乘客须要一个出租车,有一个起始时刻,起点,终点,行走路程为曼哈顿距离,每辆出租车必须在乘客一分钟之前到达.问最少须要几辆出租车 思路:假设一辆车载完一个乘客a,能去载乘客b,就连一条有向边,这样做完整个图形成一个DAG,然后要求的最少数量就是最小路径覆盖.利用二分图最大匹配去做,把每一个点拆成两点.假设有边就连边,做一次最大匹配.n - 最大匹配数就是答案 代码: #include <cstdio> #i…
链接: http://poj.org/problem?id=3020 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22010#problem/M Antenna Placement Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5500   Accepted: 2750 Description The Global Aerial Research Centr…
原题传送:http://poj.org/problem?id=3020 Antenna Placement Time Limit: 1000MS Memory Limit: 65536K Description The Global Aerial Research Centre has been allotted the task of building the fifth generation of mobile phone nets in Sweden. The most striking…
Antenna Placement Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6334   Accepted: 3125 Description The Global Aerial Research Centre has been allotted the task of building the fifth generation of mobile phone nets in Sweden. The most st…
The King’s Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3471    Accepted Submission(s): 1231 Problem Description In the Kingdom of Silence, the king has a new problem. There are N cit…
链接: http://acm.hdu.edu.cn/showproblem.php?pid=1151 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=82834#problem/J /* ************************************************************************** //二分图匹配(匈牙利算法的DFS实现) //初始化:G[][]两边顶点的划分情况 //建立G[i][…
题目链接: https://vjudge.net/problem/POJ-1422 题目大意: 有n个点和m条有向边,现在要在点上放一些伞兵,然后伞兵沿着图走,直到不能走为止 每条边只能是一个伞兵走过,问最少放多少个伞兵 解题思路: 最小路径覆盖 最小路径覆盖=|G|-最大匹配数 重点是,建图的时候,把每个点分成两部分A1,A2,如果有边A->B,就在二分图上加A1->B2 这里的巧妙可以看下面的例子 对于一条路径,起点的入度为0,终点的出度为0,中间节点的出入度都为1. 每一个点最多只能有1…
Air Raid Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 7278   Accepted: 4318 Description Consider a town where all the streets are one-way and each street leads from one intersection to another. It is also known that starting from an i…