贪心
文章平均质量分 72
sunbaofeng2
这个作者很懒,什么都没留下…
展开
-
uva11100 The Trip, 2007--贪心(输出方式想不到啊!!!)
#include#include#include#include#include#include#include #define N 10000#define M 1000001using namespace std;int a[N];int num[M];int n;int main(){// freopen("ex.in","r",stdin);原创 2012-09-08 18:31:41 · 576 阅读 · 0 评论 -
10382 - Watering Grass-----------(题目简单)卡精度啊!!wa了8次!
精度这个东西好神奇~如果判断一个double的数大于0,直接让这个double跟一个很小的数的负数比较大小~!!!!!!!!!#include#include#include#include#include#include#include #define N 10005#define MIN 1e-11#define M 1000001using nam原创 2012-09-08 20:56:19 · 407 阅读 · 0 评论 -
10720 - Graph Construction----------水过了!!
描述: 我们把序列排成不增序,即d1>=d2>=...>=dn,则d可简单图化当且仅当d'=(d2-1, d3-1, ... d(d1+1)-1, d(d1+2), d(d1+3), ... dn)可简单图化。这个定理写起来麻烦,实际上就是说,我们把d排序以后,找出度最大的点(设度为d1),把它和度次大的d1个点之间连边,然后这个点就可以不管了,一直继续这个过程,直到建出完整的图,或出现负度等明显原创 2012-09-10 23:07:56 · 474 阅读 · 0 评论 -
10057 - A mid-summer night's
#include#include#include#include#include#include#include #define N 1000000#define MIN 1e-11#define M 32010#define MM 70000using namespace std;int n,t;int a[N];int cmp(const void *a,const原创 2012-09-09 17:15:19 · 884 阅读 · 0 评论 -
10148 - Advertisement-----贪心,区间选点问题------水题
#include#include#include#include#include#include#include #define inf 0x7fffffff#define N 1000#define MIN 1e-11#define M 10001#define MM 20020#define LL long longusing namespace std;int n原创 2012-09-09 20:11:20 · 1122 阅读 · 2 评论 -
poj1456--贪心策略
#include#include#include#include#include#include#include #include#include#include#define LL long long#define inf 0x7fffffff#define E 1e-9#define M 100#define N 10005using namespace std;原创 2012-10-20 15:49:15 · 452 阅读 · 0 评论 -
UVa10718 - Bit Mask(不错的贪心)
#include#include#include#include#include#include#include#include#include#include#include#define LL long long#define UI unsigned int#define inf 0x7fffffff#define eps 1e-7#define M 105#d原创 2013-03-27 19:52:01 · 600 阅读 · 0 评论