摘要: #include#include#include#include#include#include#define lson l,m,rts;set::iterator itr;void pushUp(int rt,int m){ rsum[rt]=rsum[rt>1))) lsum... 阅读全文
posted @ 2014-11-17 14:57 JarvisLau 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 先保存一段错误的代码#include#include#include#include#define lson l,m,rt>1; build(lson); build(rson); pushUp(rt);}void update(int w,int L,int R,int l,in... 阅读全文
posted @ 2014-11-16 19:09 JarvisLau 阅读(127) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#include#include#define lson r,m,rt>1)) lsum[rt]=lsum[rt]+lsum[rt>1) rsum[rt]=rsum[rt]+rsum[rt>1; bui... 阅读全文
posted @ 2014-11-14 09:42 JarvisLau 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 做完这道题突然就感觉自己脑子是不是已经秀逗了,tle到死后才想起来找规律, 就是求排列数的题目,按插入点对状态进行分类,可以暴力tle。。。#include#include#includeusing namespace std;int main(){ int a[1111][1111];... 阅读全文
posted @ 2014-11-11 21:00 JarvisLau 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 一两个月没写代码的确是手生的厉害,debug的好艰辛,,不过看到accept时的那种满足感真的就是爽#include#include#include#include#define lson l,m,rt>1)&&lnum[rtrnum[rt>1&&lnum[rtrnum[rt>1; build... 阅读全文
posted @ 2014-11-06 19:59 JarvisLau 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 对照着notonlysuccess大牛的代码写的#include#include#include#include#define lson l,m,rt>1; build(lson); build(rson);}void pushUp(int rt,int m){ lsum[rt]=... 阅读全文
posted @ 2014-11-02 19:51 JarvisLau 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 第一次没想到用位运算,不出意料的T了,,,PS:在床上呆了接近两个月后,我胡汉三又杀回来刷题啦~~#include#include#include#include#define lson l,m,rt=L&&R>=r) { sum[rt]=c; col[rt]=1r... 阅读全文
posted @ 2014-11-02 12:22 JarvisLau 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 参考自http://www.notonlysuccess.com/index.php/segment-tree-complete/#include#include#include#include#define lson l,m,rt>1)); sum[rt>1); col... 阅读全文
posted @ 2014-09-13 20:52 JarvisLau 阅读(128) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#define lson l,m,rt>1; build(lson); build(rson);}int query(int d,int l,int r,int rt){ int ret=-1; if(l==r) { ... 阅读全文
posted @ 2014-09-12 07:43 JarvisLau 阅读(102) 评论(0) 推荐(0) 编辑
摘要: http://www.notonlysuccess.com/index.php/segment-tree-complete/#include#include#include#include#define lson l,m,rt>1; build(lson); build(rson);}v... 阅读全文
posted @ 2014-09-11 20:02 JarvisLau 阅读(157) 评论(0) 推荐(0) 编辑