![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
树状数组
文章平均质量分 86
键盘上的舞者
这个作者很懒,什么都没留下…
展开
-
Codeforces276E:Little Girl and Problem on Trees
A little girl loves problems on trees very much. Here's one of them.A tree is an undirected connected graph, not containing cycles. The degree of node x in the tree is the number of nodes y of t原创 2015-05-05 01:09:11 · 1760 阅读 · 0 评论 -
POJ3321:Apple Tree(树状数组)
DescriptionThere is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the big apple tree.原创 2015-06-25 11:16:06 · 6905 阅读 · 4 评论 -
POJ2155:Matrix(二维树状数组,经典)
DescriptionGiven an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th row and j-th column. Initially we have A[i, j] = 0 (1 We can change the matrix in the f原创 2015-06-24 12:17:51 · 4485 阅读 · 4 评论 -
POJ3067:Japan(树状数组求逆序对)
DescriptionJapan plans to welcome the ACM ICPC World Finals and a lot of roads must be built for the venue. Japan is tall island with N cities on the East coast and M cities on the West coast (M <原创 2015-06-23 21:38:11 · 3414 阅读 · 0 评论 -
SGU180:Inversions(树状数组)
There are N integers (1A[j].InputThe first line of the input contains the number N. The second line contains N numbers A1...AN.OutputWrite amount of such pairs.Sample test(s)原创 2015-06-24 09:46:00 · 1211 阅读 · 0 评论 -
POJ2029:Get Many Persimmon Trees(二维树状数组)
DescriptionSeiji Hayashi had been a professor of the Nisshinkan Samurai School in the domain of Aizu for a long time in the 18th century. In order to reward him for his meritorious career in educa原创 2015-06-23 22:18:29 · 1385 阅读 · 0 评论 -
POJ2481:Cows(树状数组)
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.原创 2015-06-23 20:22:04 · 2158 阅读 · 0 评论 -
POJ2352:Stars(树状数组)
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原创 2015-06-21 16:44:38 · 2804 阅读 · 1 评论 -
POJ1195:Mobile phones(二维树状数组)
DescriptionSuppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. The area is divided into squares. The squares form an S * S matrix with the rows an原创 2015-06-21 21:19:12 · 3533 阅读 · 0 评论 -
POJ2299:Ultra-QuickSort(树状数组求逆序数)
DescriptionIn 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原创 2015-06-21 11:06:21 · 1159 阅读 · 0 评论 -
LA2191:Potentiometers(树状数组)
题意:先给出一个数组,然后有两个操作S x y 把第x个数改成yM x y计算x~y个数的和思路:普通的树状数组,但不知道为什么会莫名其妙的一直WA#include #include #include #include #include #include #include #include #include #include #inclu原创 2015-06-18 22:49:12 · 1579 阅读 · 1 评论 -
LA4329:Ping pong(树状数组)
DescriptionN(3N20000) ping pong players live along a west-east street(consider the street as a line segment). Each player has a unique skill rank. To improve their skill rank, they often com原创 2015-06-12 22:03:56 · 2044 阅读 · 1 评论