摘要:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1789贪心 很不错的View Code 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 #include <algorithm> 5 using namespace std; 6 struct ss { 7 int x,y; 8 }num[1005]; 9 int flag[1005];10 int cmp(ss s,ss t)11 {12 if(s.y==t.y)ret 阅读全文
摘要:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1050下午没事在看一个博客里的贪心专题,虽然没写,不过想了下思路,思路对的就没看了,没思路的或者不一样的看了看。这道题没什么思路,有的思路写了下不对,就是以结束时间为依据排序,然后每次找尽量多的,这种不对我想可能是因为有一部分是从大号移动到小号的,这样就有重合了。View Code 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 #include <algorithm> 阅读全文