摘要: 树状数组是一个很简单好用的数据结构。 功能主要:区间求和,更新大小。 我们只要把原来的a数组通过不断update到c数组(即树状数组),之后就可以通过O(longn)的复杂度进行查询和更新了。 hdu1166为模板题。 #include <cstdio> #include <cstring> #de 阅读全文