随笔分类 -  树状数组

摘要:#include #include #include using namespace std;int C[1100];const int MAXN = 10;void update(int x, int ans){ C[x] = ans ; while(x 0){ ret... 阅读全文
posted @ 2015-10-21 20:27 Painting、时光 阅读(485) 评论(0) 推荐(0)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=5372/*要求有多少线段被现在加进去的线段完全覆盖,所求即左端点比当前加进去的线段大的减去右端点比当前加进去的线段大的,就是覆盖的线段树用两个树状数组来更新左端点和右端点的值跟求逆序数那道题目一样,进行排序,二分得... 阅读全文
posted @ 2015-08-14 14:35 Painting、时光 阅读(168) 评论(0) 推荐(0)
摘要:http://poj.org/problem?id=2352模板/************************************************* Author :Powatr* Created Time :2015-8-13 16:18:10* File Name... 阅读全文
posted @ 2015-08-13 16:45 Painting、时光 阅读(115) 评论(0) 推荐(0)
摘要:DescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping ... 阅读全文
posted @ 2015-03-26 18:15 Painting、时光 阅读(153) 评论(0) 推荐(0)