第一题HDU1698http://acm.hdu.edu.cn/showproblem.php?pid=1698这是在区间上进行整段的修改操作,我们就用to[]数组代表修改的lazy标记记住在构建树和在change函数中自顶向下更新的时候,一定要注意重新回去更新上层的节点,所以末尾需加上update...
分类:
其他好文 时间:
2014-08-02 01:47:52
阅读次数:
342
http://poj.org/problem?id=3667题意:两个操作 : 1 选出靠左的长度为a的区间。 2 把从 a到a+b的区间清空。线段树区间合并+lazy//bycaonima//hehe#include#include#include#include#includeusingname...
分类:
其他好文 时间:
2014-08-01 22:34:52
阅读次数:
263
Problem Description
There is an old country and the king fell in love with a devil. The devil always asks the king to do some crazy things. Although the king used to be wise and beloved by his peop...
分类:
其他好文 时间:
2014-08-01 20:00:22
阅读次数:
287
P1006:真不会线段树,更不会带LAZY的线段树。思想就是延迟标记#include#include#include#include#includeusing namespace std;#define lson l,m,rt>1; build(lson); build(rson);}v...
分类:
其他好文 时间:
2014-08-01 19:36:32
阅读次数:
221
Nice boat
Time Limit: 30000/15000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 335 Accepted Submission(s): 159
Problem Description
There is an ol...
分类:
其他好文 时间:
2014-08-01 00:03:21
阅读次数:
260
据说暴力也过了,还傻逼地写了这么长。。。
#include
#include
#include
#include
using namespace std;
#define ll long long
#define L(x) (x<<1)
#define R(x) (x<<1|1)
#define Val(x) tree[x].val
#define Lazy(x) tree[x].laz...
分类:
其他好文 时间:
2014-07-31 20:54:47
阅读次数:
283
线段树,懒惰标记 1 #include 2 #include 3 using namespace std; 4 #define N 400010 5 int sum[N],lazy[N]; 6 void pushup(int root){ 7 sum[root]=sum[root*2]+...
分类:
其他好文 时间:
2014-07-31 16:07:46
阅读次数:
255
atitit.解决net.sf.json.JSONException There is a cycle in the hierarchy
1. 环境:使用hibernate4跟个,,要不个哪的对象系列化成个json的时候儿有这个问题了...
1
2. 原因::hb默认的lazy 方式造成的当有关联对象的时候儿...
1
3. #---解决::lazy =false (推荐).. 1...
分类:
Web程序 时间:
2014-07-30 20:46:34
阅读次数:
506
Problem Description
Recently, Doge got a funny birthday present from his new friend, Protein Tiger from St. Beeze College. No, not cactuses. It's a mysterious blackbox.
After some research, Doge...
分类:
其他好文 时间:
2014-07-30 17:27:44
阅读次数:
282
题意:有n个数初始值都为1,m个操作a,b,c,表示把区间[a,b]变为c,求最后n个数的和。
经典区间更新求和问题,需要用到延迟标记(或者说是懒惰标记),简单老说就是每次更新
的时候不要更新到底,用延迟标记使得更新延迟到下次需要更新或询问的时候。
#include
#include
#include
#include
#include
#include
#inclu...
分类:
其他好文 时间:
2014-07-30 12:20:23
阅读次数:
241