![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
树状数组
文章平均质量分 68
捡石子的小孩
这个作者很懒,什么都没留下…
展开
-
poj1195 Mobile phones 二维树状数组
做得有点苦逼,各种错误,但最后还是被我发现了 #include #include #include using namespace std; int c[1025][1025],n; inline int lowbit(int k) { return k&(-k); } void insert(int x,int y,int d) { for(int i=x;i<=n;i原创 2013-01-02 15:16:31 · 547 阅读 · 0 评论 -
poj3067 Japan 树状数组&逆序对
理解题意候会发现这就是一道求逆序对的题目。以a为第一关键字,b为第二关键字按照升序对原始输入数据进行排序,然后对每个b,检查前面比它大的有几个。 #include #include #include #include using namespace std; struct way { int a,b; bool operator<(const struct way t)原创 2013-01-01 23:09:20 · 789 阅读 · 0 评论