摘要: 和经典的线段树区间lazy操作相比,区间传递的是经验系数,每个点对系数的反应是不一样的,所以向下传递的时机有所改变,不但在区间被剖分时要向下释放,在该区间有某个点要升级的时候也要释放,因为此时用区间的lazy值叠加的话会影响结果,所以此时要释放lazy,lazy只有在这个区间的点都没到达升级门槛时才可以叠加。#include#include#include#include#include#include#include#include#include#include#include#include#define tree int o,int l,int r#define lson o>1 阅读全文
posted @ 2013-10-14 21:48 baoff 阅读(213) 评论(0) 推荐(0) 编辑
摘要: Vasya's got a birthday coming up and his mom decided to give him an array of positive integersaof lengthn.Vasya thinks that an array's beauty is the greatest common divisor of all its elements. His mom, of course, wants to give him as beautiful an array as possible (with largest possible bea 阅读全文
posted @ 2013-10-14 17:09 baoff 阅读(252) 评论(0) 推荐(0) 编辑