![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Algorithm-贪心
xiaozhuaixifu
这个作者很懒,什么都没留下…
展开
-
庞果网-在线编程 我们曾经或即将经历的招聘会
题目背景: 那一年,这一年,青春散场,到毕业季,我们奔波着忙着找工作,来到招聘会上,看到黑压压的一大片人群.. 题目描述:毕业季,很多大公司来学校招聘,招聘会分散在不同时间段,小明想知道自己最多能完整的参加多少个招聘会(参加一个招聘会的时候不能中断或离开)。 假设现在有n个招聘会,每个招聘会都有个起止时间,时间由从招聘会第一天0点开始的小时数表示,n 典型的贪心算法:对结束时间排序,再遍历原创 2013-05-23 11:20:01 · 1017 阅读 · 0 评论 -
HDOJ 1009 FatMouse' Trade 贪心算法greedy so easy!
看题:http://acm.hdu.edu.cn/showproblem.php?pid=1009 代码: #include #include #include #include #include #include #include #include #include using namespace std; struct node{ double j,p; double jp; };原创 2013-06-19 14:05:24 · 1271 阅读 · 0 评论 -
HDOJ 1050 Moving Tables 贪心so easy!!
click here to check the problem:http://acm.hdu.edu.cn/showproblem.php?pid=1050 AC code: #include #include #include #include #include #include #include #include using namespace std; struct node{ i原创 2013-06-19 14:08:49 · 911 阅读 · 0 评论 -
HDOJ 1051 Wooden Sticks 贪心again! so easy!
check the problem:http://acm.hdu.edu.cn/showproblem.php?pid=1051 ac code:(use vector) #include #include #include #include #include #include #include #include using namespace std; struct wood{ int原创 2013-06-19 14:11:48 · 1050 阅读 · 0 评论 -
HDOJ 1257 最少拦截系统 贪心算法again! so easy...........................
check the problem here:http://acm.hdu.edu.cn/showproblem.php?pid=1257 the AC code: #include #include #include #include #include #include #include #include using namespace std; struct node{ int h;原创 2013-06-19 14:15:26 · 716 阅读 · 0 评论 -
HDOJ 1800 Flying to the Mars 盲目搜索......................so easy...........
check the original problem here:http://acm.hdu.edu.cn/showproblem.php?pid=1800 the AC code: #include #include #include #include #include #include using namespace std; int level[3010]; bool visit[301原创 2013-06-19 14:20:11 · 817 阅读 · 0 评论 -
HDOJ/HDU 2037 今年暑假不AC ...... sth. like interval scheduling use 贪心..so easy...
check the pro:http://acm.hdu.edu.cn/showproblem.php?pid=2037 see the code: #include #include #include #include #include using namespace std; struct time1{ int start; int end; }; bool comxy(time1原创 2013-06-19 14:24:13 · 808 阅读 · 0 评论 -
poj 1065 Wooden Sticks (贪心)
题目:http://poj.org/problem?id=1065 思路:先按照L排序转换成一维,在对W贪心即可。 #include #include using namespace std; const int MAX=5001; struct wooden{ int l,w,flag; }wd[MAX]; bool Cmp(wooden x,wooden y){ if(x.l!=y.l原创 2013-09-05 21:10:38 · 1110 阅读 · 0 评论