树状数组
文章平均质量分 77
闻道-问道
这个作者很懒,什么都没留下…
展开
-
学习日记15
今天中午,老师带领我们改变了学习策略。要先学习知识点,看题解,学习做题技巧和方法,然后再自己做题,这时候,就算做不出题来,也不能看那题解,同学之间互相商量,找出程序中的不足并解决它。 我先要制定自己的学习计划,我打算看第一个人的博客的时候,要慢慢看,把所有关于这个知识点的方法都掌握牢固,再接着看下一个,这样再看下一个人的博客时,很多相同类型的题,可能看一眼就知道怎么回事了,原创 2017-08-16 20:56:13 · 341 阅读 · 0 评论 -
1002(dp+树状数组+离散化)
Problem DescriptionHow many nondecreasing subsequences can you find in the sequence S = {s1, s2, s3, ...., sn} ? For example, we assume that S = {1, 2, 3}, and you can find seven nondecreasing subse原创 2017-08-23 19:45:22 · 251 阅读 · 0 评论 -
1014(暴力树状数组)
Problem DescriptionThere is a board with 100 * 100 grids as shown below. The left-top gird is denoted as (1, 1) and the right-bottom grid is (100, 100).We may apply three commands to the boa原创 2017-08-23 19:49:05 · 236 阅读 · 0 评论 -
1015(树状数组+数学运算)
Problem DescriptionEvery year, Farmer John's N (1 <= N <= 20,000) cows attend "MooFest",a social gathering of cows from around the world. MooFest involves a variety of events including haybale stack原创 2017-08-23 19:55:43 · 220 阅读 · 0 评论 -
Problem M (树状数组)
Problem DescriptionThere are n men ,every man has an ID(1..n).their ID is unique. Whose ID is i and i-1 are friends, Whose ID is i and i+1 are friends. These n men stand in line. Now we select an in原创 2017-10-08 21:48:39 · 206 阅读 · 0 评论 -
二维树状数组 区间求和模板(#1336 : Matrix Sum)
描述You are given an N × N matrix. At the beginning every element is 0. Write a program supporting 2 operations: 1. Add x y value: Add value to the element Axy. (Subscripts starts from 02. Sum x1 y1 x2 ...原创 2018-03-13 22:47:08 · 279 阅读 · 0 评论 -
E. Pencils and Boxes(树状数组+dp)
E. Pencils and Boxestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMishka received a gift of multicolored pencils for his birthday! Unfortunately...原创 2018-05-28 21:55:18 · 336 阅读 · 0 评论 -
Potentiometers (树状数组)
A potentiometer, or potmeter for short, is an electronic device with a variable electric resistance. Ithas two terminals and some kind of control mechanism (often a dial, a wheel or a slide) with whic...原创 2018-06-20 21:08:07 · 278 阅读 · 0 评论 -
Movie collection (树状数组)
Mr. K. I. has a very big movie collection. He has organized his collection in a big stack. Whenever hewants to watch one of the movies, he locates the movie in this stack and removes it carefully, ens...原创 2018-06-20 21:29:39 · 503 阅读 · 0 评论 -
Permutation (树状数组)
Given N and K find the N-th permutation of the integers from 1 to K when those permutations arelexicographically ordered. N starts from 0. Since N is very large N will be represented by a sequenceof K...原创 2018-06-21 20:22:43 · 272 阅读 · 0 评论 -
F、take(期望+树状数组)
Kanade has n boxes , the i-th box has p[i] probability to have an diamond of d[i] size. At the beginning , Kanade has a diamond of 0 size. She will open the boxes from 1-st to n-th. When she open a bo...原创 2018-08-03 15:38:49 · 285 阅读 · 0 评论 -
1003(树状数组+逆序对)
Problem DescriptionRecently yifenfei face such a problem that give you millions of positive integers,tell how many pairs i and j that satisfy F[i] smaller than F[j] strictly when i is smaller than j原创 2017-08-21 18:33:38 · 242 阅读 · 0 评论 -
1004(树状数组+离线操作+离散化)
Problem DescriptionAfter inventing Turing Tree, 3xian always felt boring when solving problems about intervals, because Turing Tree could easily have the solution. As well, wily 3xian made lots of n原创 2017-08-21 18:36:30 · 284 阅读 · 0 评论 -
学习日记17
今天继续看了一些题解,继续学习了一下树状数组。有关树状数组的各种题目类型,在学习日记15中,已经总结的差不多了,因为那是第一天看树状数组的题目,并且基本看完了一个人写的所有有关树状数组的博客,在之后的学习和看题解的过程中,我又发现了新的题目类型,还有之前的题目类型有的需要扩充,当时认知有限,总结的不够到位。现在补充一下。一。离线操作预处理。这个和素数预处理差不多,都是要先把数据存在一个原创 2017-08-18 20:28:56 · 260 阅读 · 0 评论 -
1005(三维树状数组+区间更新,单点求值)
Problem DescriptionGiven an N*N*N cube A, whose elements are either 0 or 1. A[i, j, k] means the number in the i-th row , j-th column and k-th layer. Initially we have A[i, j, k] = 0 (1 <= i, j, k <原创 2017-08-21 18:39:21 · 284 阅读 · 0 评论 -
1009(树状数组)
Problem DescriptionAs is known to all, the blooming time and duration varies between different kinds of flowers. Now there is a garden planted full of flowers. The gardener wants to know how many fl原创 2017-08-21 18:43:13 · 223 阅读 · 0 评论 -
1016(二维树状数组)
Problem 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 <= i, j <= N).We can chan原创 2017-08-21 18:45:30 · 186 阅读 · 0 评论 -
1017(二分+树状数组)
Problem DescriptionN (2 <= N <= 8,000) cows have unique brands in the range 1..N. In a spectacular display of poor judgment, they visited the neighborhood 'watering hole' and drank a few too many be原创 2017-08-21 18:47:22 · 340 阅读 · 0 评论 -
1019(树状数组的区间更新,区间求和)
Problem DescriptionYou have N integers, A1, A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The原创 2017-08-21 18:50:31 · 244 阅读 · 0 评论 -
1020(树状数组,逆序对+离散化)
Problem 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 t原创 2017-08-21 18:52:31 · 273 阅读 · 0 评论 -
1018(离线树状数组)
Problem DescriptionWintokk has collected a huge amount of coins at THU. One day he had all his coins fallen on to the ground. Unfortunately, WangDong came by and decided to rob Wintokk of the co原创 2017-08-25 17:36:07 · 245 阅读 · 0 评论 -
1001(树状数组基本操作的合集)
Problem DescriptionNow I am leaving hust acm. In the past two and half years, I learned so many knowledge about Algorithm and Programming, and I met so many good friends. I want to say sorry to Mr,原创 2017-08-22 20:14:24 · 371 阅读 · 0 评论 -
1006(离线操作+树状数组)
Problem DescriptionMery has a beautiful necklace. The necklace is made up of N magic balls. Each ball has a beautiful value. The balls with the same beautiful value look the same, so if two or more原创 2017-08-21 18:41:15 · 418 阅读 · 0 评论 -
D. Array Restoration(树状数组+分类)
Initially there was an array aa consisting of nn integers. Positions in it are numbered from 11 to nn.Exactly qq queries were performed on the array. During the ii-th query some segment (li,ri)(li,r...原创 2018-08-18 09:29:56 · 256 阅读 · 0 评论