随笔分类 -  树状数组

HDU 4777 Rabbit Kingdom (2013杭州赛区1008题,预处理,树状数组)
摘要:Rabbit KingdomTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 40Accepted Submission(s): 20Problem Description Long long ago, there was an ancient rabbit kingdom in the forest. Every rabbit in this kingdom was not cute but totally pugnacious, so th. 阅读全文

posted @ 2013-11-09 22:33 kuangbin 阅读(3059) 评论(0) 推荐(0)

HDU 4638 Group (2013多校4 1007 离线处理+树状数组)
摘要:GroupTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 17Accepted Submission(s): 5Problem 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 stan 阅读全文

posted @ 2013-08-01 17:54 kuangbin 阅读(1229) 评论(0) 推荐(0)

HDU 4267 A Simple Problem with Integers 第37届ACM/ICPC长春赛区网络赛1001题 (树状数组)
摘要:A Simple Problem with IntegersTime Limit: 5000/1500 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 659Accepted Submission(s): 253Problem DescriptionLet A1, A2, ... , AN be N elements. You need to deal with two kinds of operations. One type of operation is to add a give 阅读全文

posted @ 2012-09-10 17:15 kuangbin 阅读(1302) 评论(0) 推荐(0)

HDU 1556 Color the ball(树状数组)
摘要:Color the ballTime Limit: 9000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4258Accepted Submission(s): 2285Problem DescriptionN个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a <= b),lele便为骑上他的“小飞鸽"牌电动车从气球a开始到气球b依次给每个气球涂一次颜色。但是N次以后lele已经忘记了第I个气球已经涂过几次颜色了,你能帮他算出 阅读全文

posted @ 2012-08-23 10:38 kuangbin 阅读(2999) 评论(0) 推荐(1)

HDU 1394 Minimum Inversion Number(求逆序数,线段树或者树状数组)
摘要:Minimum Inversion NumberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4647Accepted Submission(s): 2809Problem DescriptionThe inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j and ai 阅读全文

posted @ 2012-08-15 02:11 kuangbin 阅读(4002) 评论(0) 推荐(1)

HDU 1166 敌兵布阵(线段树,树状数组)
摘要:敌兵布阵Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18473Accepted Submission(s): 8034Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数 阅读全文

posted @ 2012-08-11 16:36 kuangbin 阅读(778) 评论(0) 推荐(0)

POJ 3067 Japan(树状数组求逆序对)
摘要:JapanTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 14795Accepted: 3968DescriptionJapan 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 <= 1000, N <= 1000 阅读全文

posted @ 2012-08-09 17:01 kuangbin 阅读(1128) 评论(0) 推荐(0)

POJ 2481 Cows(树状数组)
摘要:CowsTime Limit: 3000MSMemory Limit: 65536KTotal Submissions: 8497Accepted: 2777DescriptionFarmer 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 阅读全文

posted @ 2012-08-09 16:00 kuangbin 阅读(3598) 评论(0) 推荐(0)

POJ 1195 Mobile phones(二维树状数组)
摘要:Mobile phonesTime Limit: 5000MSMemory Limit: 65536KTotal Submissions: 11018Accepted: 5044DescriptionSuppose 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 and columns numbe 阅读全文

posted @ 2012-08-09 13:40 kuangbin 阅读(551) 评论(0) 推荐(0)

POJ 2352 Stars(树状数组)
摘要:StarsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 22464Accepted: 9787DescriptionAstronomers 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 t 阅读全文

posted @ 2012-08-09 12:56 kuangbin 阅读(3880) 评论(0) 推荐(1)

POJ 2299 Ultra-QuickSort(求逆序数,归并排序或者离散化+树状数组)
摘要:Ultra-QuickSortTime Limit: 7000MSMemory Limit: 65536KTotal Submissions: 27665Accepted: 9915DescriptionIn 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 sequence is sorted 阅读全文

posted @ 2012-08-09 12:22 kuangbin 阅读(1548) 评论(0) 推荐(0)

导航

JAVASCRIPT: