(一)树状数组的概念如果给定一个数组,要你求里面所有数的和,一般都会想到累加。但是当那个数组很大的时候,累加就显得太耗时了,时间复杂度为O(n),并且采用累加的方法还有一个局限,那就是,当修改掉数组中的元素后,仍然要你求数组中某段元素的和,就显得麻烦了。所以我们就要用到树状数组,他的时间复杂度为O(... Read More
posted @ 2014-08-15 20:22 四十四次日落 Views(458) Comments(1) Diggs(0) Edit
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2689 Sort itProblemDescriptionYouwanttoprocesseasequenceofndistinctintegersbyswap... Read More
posted @ 2014-08-15 20:11 四十四次日落 Views(428) Comments(0) Diggs(0) Edit
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2838 Cow SortingProblemDescriptionSherlock'sN(1≤N≤100,000)cowsarelineduptobemilkedinthee... Read More
posted @ 2014-08-15 20:05 四十四次日落 Views(546) Comments(0) Diggs(0) Edit
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2227 Find the nondecreasing subsequences Time Limit: 10000/5000 MS (Java/Othe... Read More
posted @ 2014-08-15 19:54 四十四次日落 Views(263) Comments(0) Diggs(0) Edit
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3584 CubeProblemDescriptionGivenanN*N*NcubeA,whoseelementsareeither0or1.A[i,j,k]m... Read More
posted @ 2014-08-15 19:50 四十四次日落 Views(418) Comments(0) Diggs(0) Edit
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2492 Ping pongProblemDescriptionN(3 2 #include 3 #define size 100100 4 int n,c[size],x1... Read More
posted @ 2014-08-15 19:41 四十四次日落 Views(396) Comments(0) Diggs(0) Edit
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1394 Minimum Inversion Number Time Limit: 2000/1000 MS (Java/Others)Memory Limi... Read More
posted @ 2014-08-15 19:37 四十四次日落 Views(257) Comments(0) Diggs(0) Edit
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3743 Frosh WeekTimeLimit:2000/1000ms(Java/Other)MemoryLimit:32768/32768K(Java/Other)... Read More
posted @ 2014-08-15 19:29 四十四次日落 Views(232) Comments(0) Diggs(0) Edit
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1892 See you~ProblemDescriptionNowIamleavinghustacm.Inthepasttwoandhalfyears,Ilearn... Read More
posted @ 2014-08-15 19:22 四十四次日落 Views(446) Comments(0) Diggs(0) Edit
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1559最大子矩阵Time Limit: 30000/10000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Subm... Read More
posted @ 2014-08-15 19:17 四十四次日落 Views(658) Comments(0) Diggs(0) Edit