随笔分类 - 树状数组
摘要:描述 传送门:我是传送门 White Rabbit has a rectangular farmland of n*m. In each of the grid there is a kind of plant. The plant in the j-th column of the i-th ro
阅读全文
摘要:描述 传送门:我是传送门 Given a sequence of integers a1,a2,…,ana1,a2,…,an and qq pairs of integers (l1,r1),(l2,r2),…,(lq,rq)(l1,r1),(l2,r2),…,(lq,rq), find count
阅读全文
摘要:描述 参考资料:我是传送门 一维树状数组的差分写法 二维树状数组 注意要差分处理 一维树状数组 (1). 单点修改+区间查询 (2). 区间修改+单点查询 // 给位置p增加x<br /> void add(int p,int x) { while(p <= n) sum[p] += x,p
阅读全文

浙公网安备 33010602011771号