ACM-树状数组
文章平均质量分 86
蝉鸣的夏季
要在IT这条不归路上,越走越远了。
展开
-
树状数组求序列的区间和
给你一个序列,求任意区间的和。 树状数组的思路: #include #include #include using namespace std; int n; int a[100]; int c[100]; int lowbit(int x){ return x&(-x); } void build(int p,int num){ while(p<=n){原创 2017-04-09 20:14:36 · 504 阅读 · 0 评论 -
poj 2299 Ultra-QuickSort
Description 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 elements until the seque原创 2017-04-10 14:43:44 · 196 阅读 · 0 评论