
树状数组
curry___
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
树状数组总结(单点修改 区间查询;区间修改 单点查询;区间修改 区间查询)
树状数组一般有三种题型吧 (1) 单点修改 区间查询 这应该是最简单的一个了,不多说了 #include<bits/stdc++.h> using namespace std; #define maxn 1100 #define lowbit(i) ((i)&(-i)) int n,c[maxn]; // 单点修改 区间查询 void update(int i,int...原创 2018-09-11 21:22:56 · 281 阅读 · 0 评论 -
树状数组
原文地址:http://www.cnblogs.com/acgoto/p/8583952.html 先贴一下树状数组的模板代码: int lowbit(int i) { return i & -i;//或者是return i-(i&(i-1));表示求数组下标二进制的非0最低位所表示的值 } void update(int i,int val)//单点更新 { ...转载 2018-09-09 16:07:49 · 134 阅读 · 0 评论 -
训练赛20190304
D - Balanced Lineup For the daily milking, Farmer John'sNcows (1 ≤N≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the ...原创 2019-03-05 19:31:47 · 242 阅读 · 0 评论 -
20190402训练赛
Problem A Patches 1 s, 256 MB 【Description】Carlos is very concerned with the environment. Whenever possible, he tries to use less polluting means of transport. He recently got a job close to home a...原创 2019-04-04 16:40:38 · 404 阅读 · 0 评论