贪心算法
文章平均质量分 62
includenaneve
include the world!
展开
-
HDU 1009 贪心水题
HDU 1009 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1009 题目分析: 肥老鼠用猫粮跟仓管猫换java豆,有多个仓库,每个仓库换取java豆的比率不同。根据比率排序。一个一个仓库的换。直到猫粮耗尽。 代码: #include #include using namespace std; struct A {原创 2015-03-08 22:32:04 · 395 阅读 · 0 评论 -
HDU 1789 贪心水题
HDU 1789 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1789 题目分析: 这是为广大学生服务的题目,关于做那科作业会使毕业评定最好。 这也是一个贪心水题。根据分数排序。 代码: #include #include #include struct node { int date; int原创 2015-03-08 22:36:24 · 359 阅读 · 0 评论 -
HDU 2037 贪心水题
HDU 2037 题目:http://acm.hdu.edu.cn/showproblem.php?pid=2037 题目分析: 这题是个贪心水题,找好策略,只要按电视节目结束时间排序,然后尽可能的添加节目。 代码: #include #include using namespace std; struct node { int st; in原创 2015-03-08 22:16:10 · 321 阅读 · 0 评论 -
Poj 3253 贪心水题
HDU 2037 题目:http://poj.org/problem?id=3253 题目分析: 题目大意:用一块足够大的木板,分割成一块块的木材做成栅栏,但是得收费,每割x长的木板花x块钱。但是这题的代码做法相反。收费的长度可以等于两个两个拼起来。 代码:#include #include #include using namespace std; pri原创 2015-03-08 22:27:19 · 375 阅读 · 0 评论