摘要:Antenna PlacementTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 4739Accepted: 2359DescriptionThe 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
阅读全文
摘要:AsteroidsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 10288Accepted: 5556DescriptionBessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 <= N <= 500). The grid contains K asteroids (1 <= K <= 10,000), which are convenientl
阅读全文
摘要:Oil SkimmingTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 87Accepted Submission(s): 50Problem DescriptionThanks to a certain "green" resources company, there is a new profitable industry of oil skimming. There are large slicks of crude
阅读全文
摘要:/**********************************************二分图匹配(Hopcroft-Carp的算法)。初始化:g[][]邻接矩阵调用:res=MaxMatch(); Nx,Ny要初始化!!!时间复杂大为 O(V^0.5 E)适用于数据较大的二分匹配 ***********************************************/ const int MAXN=3001;const int INF=1<<28;int g[MAXN][MAXN],Mx[MAXN],My[MAXN],Nx,Ny;int dx[MAXN],dy[MA
阅读全文
摘要:Rain on your ParadeTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 655350/165535 K (Java/Others)Total Submission(s): 1310Accepted Submission(s): 373Problem DescriptionYou’re giving a party in the garden of your villa by the sea. The party is a huge success, and everyone is here. It’s a warm, sun
阅读全文
摘要:SwapTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 459Accepted Submission(s): 129Special JudgeProblem DescriptionGiven an N*N matrix with each entry equal to 0 or 1. You can swap any two rows or any two columns. Can you find a way to make all the
阅读全文
摘要:棋盘游戏Time Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 5Accepted Submission(s) : 4Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem Description小希和Gardon在玩一个游戏:对一个N*M的棋盘,在格子里放尽量多的一些国际象棋里面的“车”,并且使得他们不能互相攻击,这当然很简单,但是Gardon限制了只有某些格子才可以放,小希还是很轻
阅读全文
摘要:题目大意:有p个课程和n个学生,每个学生可以自由选择课程(0到p个),现在要建立一个委员会,问是否能找到每个课程都有学生代表的集合,一个学生只能代表一个课程题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1083简单的二分匹配,用匈牙利算法就可以,主要是练习模板,固定方法解题!程序:#include<stdio.h>#include<iostream>using namespace std;#define MAXN 305int g[MAXN][MAXN];int uN,vN;int linker[MAXN];bool us
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2444题意: 有n个学生,有m对人是认识的,每一对认识的人能分到一间房,问能否把n个学生分成两部分,每部分内的学生互不认识,而两部分之间的学生认识。如果可以分成两部分,就算出房间最多需要多少间,否则就输出No。分析:先是要判断是否为二部图,然后求最大匹配。这里的程序hungary()用vector实现/*HDU 2444 The Accomodation of Students*/#include<iostream>#include<string.h>#include<
阅读全文
摘要:Fire NetTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2349Accepted Submission(s): 1342Problem DescriptionSuppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a st
阅读全文
摘要:一、最大匹配——匈牙利算法/****************************************************二分图匹配(匈牙利算法的DFS实现)INIT:g[][]两边定点划分的情况CALL:res=hungary();输出最大匹配数优点:适于稠密图,DFS找增广路快,实现简洁易于理解时间复杂度:O(VE);****************************************************/const int MAXN=1000;int uN,vN; //u,v数目int g[MAXN][MAXN];//编号是0~n-1的 int linker[M
阅读全文