![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
树状数组
稳健的不二少年
代码简洁,思维严谨,每遇不会,必求甚解。
展开
-
树状数组例题(poj2299)
传送门:http://poj.org/problem?id=2299 In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elem...原创 2019-08-19 08:45:14 · 99 阅读 · 0 评论 -
树状数组简单说明
树状数组其初衷是解决数据压缩里的累积频率(Cumulative Frequency)的计算问题,现多用于高效计算数列的前缀和, 区间和。它可以以 {\displaystyle O(\log n)} O(\log n)的时间得到任意前缀和 {\displaystyle \sum _{i=1}^{j}A[i],1<=j<=N} {\displaystyle \sum _{i=1}^{j}A...原创 2019-08-26 17:08:03 · 114 阅读 · 0 评论 -
HDU556
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1556 //简单树状数组练习 #include<iostream> #include<cstdio> #include<string> using namespace std; const int maxn =1e5+10; int tree[maxn]; int n;...原创 2019-08-30 08:14:39 · 71 阅读 · 0 评论