树状数组
树状数组
浪漫些许潦草
这个作者很懒,什么都没留下…
展开
-
hdu 3015 Disharmony Trees(树状数组)
Disharmony TreesProblem DescriptionOne day Sophia finds a very big square. There are n trees in the square. They are all so tall. Sophia is very interesting in them.She finds that trees maybe disharmon原创 2017-06-05 20:30:37 · 503 阅读 · 0 评论 -
poj 2352 Stars(树状数组)
StarsDescriptionAstronomers 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原创 2017-04-14 14:44:51 · 517 阅读 · 0 评论 -
poj 2299 Ultra-QuickSort(归并排序)||(树状数组+离散化)
Ultra-QuickSortDescriptionIn 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原创 2017-04-13 21:01:56 · 464 阅读 · 0 评论 -
hdu 1166 敌兵布阵(基础树状数组)(基础线段树--单点更新)
敌兵布阵Problem Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监原创 2017-04-12 21:53:09 · 417 阅读 · 0 评论 -
poj 1195 Mobile phones(二维树状数组)
Mobile phonesDescriptionSuppose 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原创 2017-04-14 15:46:08 · 337 阅读 · 0 评论 -
HIT 1867 经理的烦恼(树状数组)
经理的烦恼erry是一家公司销售部门的经理。这家公司有很多连锁店,编号为1,2,3,… Jerry每天必须关注每家连锁店的商品数量及其变化,一项很乏味的工作。在连锁店比较少的时候,Jerry喜欢计算编号在[i,j]区间内的连锁店中商品数量为素数的有多少家,但是现在连锁店的数量急剧增长,计算量很大,Jerry很难得出结果。 输入格式 题目有多组输入。每组输入第一行有三个整数:C 连锁店的数量 N原创 2017-04-18 07:44:11 · 334 阅读 · 0 评论 -
poj 2155 Matrix(二维树状数组)(经典)
MatrixDescriptionGiven 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 change the mat原创 2017-04-19 18:11:50 · 430 阅读 · 0 评论 -
hdu 5542 The Battle of Chibi(DP+树状数组+离散化)
The Battle of ChibiProblem Description Cao Cao made up a big army and was going to invade the whole South China. Yu Zhou was worried about it. He thought the only way to beat Cao Cao is to have a spy原创 2017-04-26 16:36:16 · 519 阅读 · 0 评论 -
nyoj 123 士兵杀敌(四)(树状数组——插线问点)
士兵杀敌(四)描述 南将军麾下有百万精兵,现已知共有M个士兵,编号为1~M,每次有任务的时候,总会有一批编号连在一起人请战(编号相近的人经常在一块,相互之间比较熟悉),最终他们获得的军功,也将会平分到每个人身上,这样,有时候,计算他们中的哪一个人到底有多少军功就是一个比较困难的事情,军师小工的任务就是在南将军询问他某个人的军功的时候,快速的报出此人的军功,请你编写一个程序来帮助小工吧。假设起始时所原创 2017-04-27 08:29:59 · 534 阅读 · 0 评论 -
poj 1990 MooFest(树状数组)
MooFestDescriptionEvery 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 stacking,原创 2017-04-30 14:48:02 · 556 阅读 · 1 评论 -
poj 3321 Apple Tree(树状数组)(区间建树)
Apple TreeDescriptionThere 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 tr原创 2017-04-21 13:56:55 · 801 阅读 · 0 评论