
贪心
poursoul
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU 1054 Strategic Game 二分匹配 | 树型DP | 贪心
Strategic GameTime Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4717 Accepted Submission(s): 2133Problem DescriptionBob enjoys pl原创 2014-06-08 12:11:01 · 1276 阅读 · 2 评论 -
ZOJ 3790 Consecutive Blocks 贪心
Consecutive BlocksTime Limit: 2 Seconds Memory Limit: 65536 KB There are N (1 ≤ N ≤ 105) colored blocks (numbered 1 toN from left to right) which are lined up in a row. And the i-th b原创 2014-06-02 05:04:58 · 1439 阅读 · 0 评论 -
【HDU】4915 Parenthese sequence 贪心
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=4915原创 2014-08-06 10:06:56 · 836 阅读 · 0 评论 -
【HDU】4912 Paths on the tree 离线LCA+贪心
传送门:【HDU】4912 Paths on the tree【HDU】4912 Paths on the tree原创 2014-11-14 09:40:17 · 1121 阅读 · 0 评论 -
【HDU】5859 Captain is coding【优先队列贪心】
题目链接:Captain is coding二分Z用了多少次,然后枚举deadline小的用了多少Z,再优先队列模拟#include <bits/stdc++.h>using namespace std ;typedef long long LL ;#define clr( a , x ) memset ( a , x , sizeof a )const int MAXN = 1005 ;stru原创 2016-10-08 11:44:57 · 541 阅读 · 0 评论 -
【51nod】1302 矩形面积交【优先队列贪心】
题目链接:【51nod】1302 矩形面积交因为最后可以旋转,所以每一组的矩形一定是短边对短边,长边对长边。 考虑短边最短的一定在AA组,然后我们将其余的矩形按照长边排序,枚举在BB组的最短长边,逐个将矩形插入优先队列,然后优先队列中个数大于NN时,取出短边最短的加入AA,然后同时维护两组矩形的面积即可。 因为此时相当于固定了AA组的短边(最小只可能是一开始孤立出来的矩形),AA组的长边以及BB原创 2016-11-05 10:24:35 · 1001 阅读 · 0 评论 -
【HDU】5932.Backpack on Tree 【贪心+背包】
题目链接:Backpack on Tree每层,对价值除以花费的斜率从大到小排序,然后贪心到恰好大于询问的容量t,接下来开始dp。 设dp[i][j]表示贪心到第i个物品,取出里面花费为j的最小价值。dp2[i][j]表示斜率从小到大(即从右到左)取出花费为j的最大代价。 假设现在贪心得到的价值为t2(因为最大花费为5,所以t2-t<5),然后我枚举从贪心的解里面丢掉花费为x的最小价值dp[i]原创 2016-10-08 10:51:52 · 1232 阅读 · 0 评论