
ACM_树状数组
kewlgrl
好大一只咸鱼哇
展开
-
POJ 3321-Apple Tree(树状数组)
Apple TreeTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 23729 Accepted: 7132DescriptionThere is an apple tree outside of kaka's house. Every autumn, a原创 2016-04-09 14:10:02 · 771 阅读 · 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): 15491 Accepted Submission(s): 7731Problem DescriptionN个气球排成一排,从左到右依原创 2016-05-06 14:00:51 · 945 阅读 · 0 评论 -
POJ 1195-Mobile phones(二维树状数组-区间更新区间查询)
Mobile phonesTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 17661 Accepted: 8173DescriptionSuppose that the fourth generation mobile phone base station原创 2016-05-06 15:50:33 · 1212 阅读 · 0 评论 -
树状数组
树状数组:用线性数据结构的方法解决动态统计子树权和的问题。类似于线段树,将区间分成小段,方便计算权和。举个栗子,将a数组构造成树状数组c。如果a数组中共有8个元素a[1]~a[8],注意这里数组的下标要从1开始,那么:c[1]=a[1]c[2]=a[1]+a[2] c[3]=a[3]c[4]=a[1]+a[2]+a[3]+a[4]c[5]=a[5]原创 2016-04-09 14:28:33 · 443 阅读 · 0 评论 -
POJ 2299-Ultra-QuickSort(树状数组求逆序数)
Ultra-QuickSortTime Limit: 7000MS Memory Limit: 65536KTotal Submissions: 52967 Accepted: 19434DescriptionIn this problem, you have to analyze a particular sorting原创 2016-05-07 10:44:46 · 1478 阅读 · 3 评论 -
POJ 3928-Ping pong(树状数组+加/乘法原理)
Ping pongTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2982 Accepted: 1103DescriptionN(3<=N<=20000) ping pong players live along a west-east street(原创 2016-08-08 12:14:10 · 815 阅读 · 0 评论 -
POJ 2352-Stars(树状数组-星系)
StarsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 46418 Accepted: 20020DescriptionAstronomers often examine star maps where stars are represented by原创 2017-04-15 13:39:41 · 510 阅读 · 0 评论 -
POJ 2155-Matrix(二维树状数组-区间修改 单点查询)
MatrixTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 27355 Accepted: 10003DescriptionGiven an N*N matrix A, whose elements are either 0 or 1. A[i, j] m原创 2017-05-04 18:19:22 · 710 阅读 · 0 评论 -
POJ 3067-Japan(树状数组-逆序数)
JapanTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 27557 Accepted: 7455DescriptionJapan plans to welcome the ACM ICPC World Finals and a lot of roads原创 2017-05-04 18:23:14 · 668 阅读 · 0 评论