摘要:
DescriptionFarmer John's cows have discovered that the clover growing along the ridge of the hill (which we can think of as a one-dimensional number line) in his field is particularly good.Farmer John has N cows (we number the cows from 1 to N). Each of Farmer John's N cows has a range of cl 阅读全文
posted @ 2012-08-08 21:14
crying_Dream
阅读(434)
评论(0)
推荐(0)
摘要:
DescriptionAstronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars that are not higher and not to the right of the given star. Astronomers want to know the distribution of the leve 阅读全文
posted @ 2012-08-08 15:47
crying_Dream
阅读(1462)
评论(0)
推荐(0)
摘要:
int c[N], n; int Lowbit(int t) //求某一点的管辖范围{ return t&(t^(t-1)); //也可以写成 return t&(-t);}int Sum(int end) //求区间和{ int sum = 0; while(end > 0) { sum += c[end]; end -= Lowbit(end); } return sum;}void add(int li, int val) //开始构建一个树状数组, 也可以修改数组{ while(li<=n) { ... 阅读全文
posted @ 2012-08-08 15:36
crying_Dream
阅读(335)
评论(0)
推荐(0)
浙公网安备 33010602011771号