PostersTime Limit: 5000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2061Accepted Submission(s): 455Problem DescriptionTed has a new house with a huge window. In this big summer, Ted decides to decorate the window with some posters to prevent the glare outside. Read More
iterator lower_bound( const key_type &key ) 函数用法,返回一个迭代器,指向键值>= key的第一个元素。iterator upper_bound( const key_type &key ) 函数用法,返回一个迭代器,指向键值> key的第一个元素。 Read More
View Code //树状数组 + 简单DP//同hdu 3450,dp的求和操作由树状数组来求执行#include<cstdio>#include<cstring>#include<algorithm>using namespace std;const int maxn = 500010;const int mod = 1000000007;__int64 c[maxn],a[maxn],val[maxn],b[maxn];int tot;int lowbit(int x){ return x&-x;}void update(int x,__in Read More
先用简单线段树记录当前线段的左右两端下来的线段编号再从上往下dp下来即可具体做法:先按高度升序排序,依次插入各条线段,每次先询问,后插入线段树只有一个域id【x】,表示当前区域被哪个线段完全覆盖View Code #include<cstdio>#include<cstring>#include<ctype.h>#include<algorithm>using namespace std;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1const int maxn = 111 Read More
直接把hotel那题的代码拿过来,其他的都用stl来做了View Code #include<cstdio>#include<vector>#include<algorithm>using namespace std;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1const int maxn = 55555;int lsum[maxn<<2],rsum[maxn<<2],msum[maxn<<2],cover[maxn<<2];struc Read More