
+ 贪心
文章平均质量分 66
codekun
这个作者很懒,什么都没留下…
展开
-
POJ 1328 - Radar Installation [贪心]
DescriptionAssume 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,原创 2015-03-08 18:06:22 · 433 阅读 · 0 评论 -
UVa 1149 - Bin Packing [贪心]
这题算贪心中最简单的,属于背包问题吧,写的效率有点低,用数组加指针控制应该更好。#include #include #include #include #include using namespace std;int main(){ int T; cin >> T; while(T--){ deque a; int n, k; c原创 2015-03-13 17:23:06 · 483 阅读 · 0 评论 -
第三届ACM山东省赛 Pick apples [贪心+动规]
超大背包问题,刚开始想复杂了。分段填充背包,前面一大部分用性价比最高的填充,最后一部分动规就可以了。题目链接:http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2408Pick applesTime Limit: 1000ms Memory limit: 165536K 有原创 2015-04-12 21:42:25 · 794 阅读 · 0 评论 -
POJ 2437 - Muddy roads [贪心法]
题意:给定n个泥坑路面的初末位置,判断最少需要几个桥才能覆盖这些路面。贪心法,从每个泥坑的开始位置建桥,然后判断是否覆盖后面的路面,就是分类讨论了。#include #include #include #include #include #include using namespace std;struct Seg{ int l, r; Seg(int l = 0, i原创 2015-04-08 23:11:45 · 592 阅读 · 0 评论