
树状数组
iteye_4729
这个作者很懒,什么都没留下…
展开
-
hdu 1166 敌兵布阵(用树状数组)
敌兵布阵 仍然是敌兵布阵那题,题目大意:给你一串数,然后会根据题意选择一点增加或减少,或者询问某区间的人数有多少?之前用线段树写了,而这题可以用树状树状来做,更加方便更加快速。说下树状数组的三个主要函数:(神一样的函数,不只这些用处!!!)1.lowbit(int i)2.update(int i, int x)3.sum(int i)链接:http://acm....2011-08-07 21:16:33 · 196 阅读 · 0 评论 -
poj 2155 Martrix(二维树状数组)
MatrixTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 10282 Accepted: 3859DescriptionGiven an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the ...2011-08-10 19:22:00 · 184 阅读 · 0 评论 -
hdu 3584 Cube(三维树状数组)
CubeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 660 Accepted Submission(s): 309Problem DescriptionGiven an N*N*N cube A, whose ele...2011-08-10 19:21:37 · 80 阅读 · 0 评论 -
hdu 2492 ping pong(逆序数与顺序数)
Ping pongTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1143 Accepted Submission(s): 387Problem DescriptionN(3<=N<=20000) ping p...2011-08-10 19:20:32 · 231 阅读 · 0 评论 -
poj 2481 Cows(stars的变形+离散化)
CowsTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 6854 Accepted: 2211DescriptionFarmer John's cows have discovered that the clover growing along the ridge of ...2011-08-09 00:39:43 · 147 阅读 · 0 评论 -
hdu 3743 Frosh Week(离散化+树状数组)
Frosh Week Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 289 Accepted Submission(s): 72Problem DescriptionDuring Frosh Week, students...2011-08-09 00:09:00 · 117 阅读 · 0 评论 -
poj 2299 Ultra-QuickSort(求逆序数:离散化+树状数组)
Ultra-QuickSortTime Limit: 7000MS Memory Limit: 65536KTotal Submissions: 22147 Accepted: 7897DescriptionIn this problem, you have to analyze a particular sorting algorith...2011-08-08 16:10:49 · 115 阅读 · 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): 2340 Accepted Submission(s): 1372Problem DescriptionN个气球排成一排,从左到右依次编号为1,2...2011-08-08 15:37:34 · 79 阅读 · 0 评论 -
hdu 1541 Stars(最基础的树状数组)
StarsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1287 Accepted Submission(s): 503Problem DescriptionAstronomers often examine star ...2011-08-08 15:25:31 · 101 阅读 · 0 评论 -
hdu 2227 Find the nondecreasing subsequences(DP+树状数组+离散化)
Find the nondecreasing subsequencesTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 503 Accepted Submission(s): 192Problem DescriptionH...2011-11-13 00:17:07 · 188 阅读 · 0 评论