http://acm.hdu.edu.cn/showproblem.php?pid=5037网络赛 北京 比较难的题FrogTime Limit: 3000/1500 MS (Java/Others)Memory Limit: 262144/262144 K (Java/Others)Total S...
分类:
其他好文 时间:
2014-09-21 20:44:21
阅读次数:
337
解法: (1)搜索(30分) (2)二分(此题属于最大值最小问题) (3)贪心+并查集下面着重说一下“贪心+并查集” 因为有A、B两座监狱,每个犯人不是在A,就是在B监狱。 至于每个犯人在那个监狱,我们可以人为的指定,但在指定时要考虑和他有怨气的所有人,太复杂了! 反过来,我们可...
分类:
其他好文 时间:
2014-09-20 15:57:39
阅读次数:
229
题目:Alice还有Bob 轮流在已知的15中俄罗斯方块上放置瓷砖,Alice放置的是垂直的2*1的矩形;
Bob放置的是水平的1*2的矩形,Alice 先开始放,最后没位置可以放者输,判断胜者。
分析:博弈,贪心。一看到以为是博弈,结果直接贪心过了。
首先,相同形状的方块压缩,一共有8中不同的方块。得到A,B优先级:...
分类:
其他好文 时间:
2014-09-20 14:06:07
阅读次数:
235
http://acm.hdu.edu.cn/showproblem.php?pid=1050题意:不占用通道就可以同时过,占用通道就不能同时过,问最短的时间全部搬完桌子。贪心策略--每个房子前的通道用数组a[200]表示,占用通道就加+1;占用通道最大的数,就是最短的时间再乘以10;需要注意的是房间...
分类:
其他好文 时间:
2014-09-19 13:40:15
阅读次数:
259
UVA 10249 - The Grand Dinner
题目链接
题意:给定几队队员,几张桌子,每队有一个人数,每个桌子也有一个容量上限,要求一种安排方案,使得没有同队人坐在一个桌子上,求方案
思路:明显贪心可以搞- -, 每次往容量最多的桌子塞就可以了。。不过这题既然出在网络流这章,还是用网络流也搞了下
源点连到每队,桌子连到汇点,容量就是容量,然后每队和每个桌子相连,...
分类:
其他好文 时间:
2014-09-18 20:43:24
阅读次数:
276
题目:有一些岛屿,分布在一条线上,问青蛙最少的能力是跳多远,可以不超过m次跳刀对岸。
分析:贪心,二分。已知能力的话,每次跳到最远即可,所以二分能力即可。
说明:2011大连网选题4。(2011-09-19 01:09)
#include
#include
int Leng[ 500005 ];
int Data[ 500005 ];
int Queue[ 500005 ];
...
分类:
其他好文 时间:
2014-09-18 16:34:54
阅读次数:
147
Description
Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, l...
分类:
其他好文 时间:
2014-09-18 14:53:34
阅读次数:
213
Description
Farmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around the barn. He always wants to have one cow working on cleaning things up and has divided ...
分类:
其他好文 时间:
2014-09-18 14:53:14
阅读次数:
213
http://acm.hdu.edu.cn/showproblem.php?pid=2037贪心问题---选择不相交区间问题。小白书152页。(ai,bi),b从小到大排序后,贪心策略:一定要选第一个区间。为什么小白书上有。今年暑假不ACTime Limit: 2000/1000 MS (Java/...
分类:
其他好文 时间:
2014-09-18 14:46:54
阅读次数:
226
初看真以为是网络流呢,实际上应是贪心算法,最简洁的算法:/*ID: qq104801LANG: C++TASK: job*/#include #include #include #include #include #include #include using namespace std;const...
分类:
其他好文 时间:
2014-09-18 13:05:03
阅读次数:
180