摘要:
http://poj.org/problem?id=1328这个题目就是每个岛屿对应一个雷达区间,然后确定好雷达区间后,然后在将区间的s或者e从小到大排序,然后贪心。第一种按s从小到大排序:View Code #include <iostream>#include <cstdio>#include <cstring>#include <cmath>#include <algorithm>#define maxn 1007using namespace std;struct node{ int x,y;}tagp[maxn];struc 阅读全文
posted @ 2012-02-23 22:12
E_star
阅读(5860)
评论(0)
推荐(0)
摘要:
http://poj.org/problem?id=2965和pku1753 一样的思路,可是自己敲了三四遍还是不出结果。就叫比较细心的GTL来帮忙看了看。。结果最重要的地方终于检查了出来,就是再change函数里面对要改变的那一点改变了两次。唉,,这错误找出来不容易啊。。。思路:将每个点压缩进一维数组,然后每个点枚举他的两种状态(改变或者不改变),最后得出结果。View Code #include <iostream>#include <cstdio>#include <cstring>#define maxn 10#define inf 99999999 阅读全文
posted @ 2012-02-23 19:29
E_star
阅读(193)
评论(0)
推荐(0)


浙公网安备 33010602011771号