
树状数组
THE END GAME
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
树状数组及应用
处理区间问题的常用方法(很麻烦) //树状数组 //单点修改,区间查询 //单点查询,区间修改 //时空复杂度(O(m*log2(n)),O(n)) #include <bits/stdc++.h> using namespace std; const int N=1000000+5; int a[N]; int c[N]; int lowbit(int x){ retur...原创 2019-02-19 01:25:46 · 200 阅读 · 0 评论 -
暑假集训日记——7.30(牛客)
【一】n的约数 题解: 2)然后很容易发现一个规律:如果两个数的约数个数相同,那么指数大小按递减顺序排列的话所获得的数更小。 举个例子: 6个约数:12=2^2 *3, 18=2 * 3^2 24个约数:360=2^3 *3^2 *5, 540=2^2 * 3^3 *5 因为我们关注的就是寻找最大数目的约数,所以不需要考虑这个满足条件的数字具体是什么,所以直接考虑如何构造约数,使得原数字尽量小,...原创 2019-07-30 21:07:52 · 205 阅读 · 0 评论 -
暑假集训日记——8.4( 点分治+康拓展开+组合数)
点分治详解:大佬的博客 P3806 【模板】点分治1 模板代码: #include <cstdio> #include <cstring> #include <algorithm> using namespace std; #define inf 999999999 int n,m,len=0,Size; struct node{int x,y,z,next...原创 2019-08-05 12:04:23 · 183 阅读 · 0 评论 -
暑假集训日记——8.6(codeforce)
D. Suitable Replacement 题意:把 S串中的?转化为小写字母,使得字符串 S拥有最多的 字符串T的不相交字串,(S中的字母可以互换顺序) 题解:贪心 #include<bits/stdc++.h> #define mp make_pair using namespace std; typedef long long ll; typedef pair<int...原创 2019-08-07 12:15:56 · 216 阅读 · 0 评论