
树状数组
zhaohuc
这个作者很懒,什么都没留下…
展开
-
树状数组(一)
如果给定一个数组A1,A2,A3…An。可能的操作为: 第i个数加d 计算从第i个数到第j个数的和(包含第i个和第j个且1<=i<=j<=n) 类似的题目:hdu1166 一般都会想到直接暴力,时间复杂度为O(n)。如果有m次操作时间复杂度就为O(m*n),这样就显得太耗时了。,所以我们就要用到树状数组,他的时间复杂度为O(m*lgn)。说到树状数组就少不了下面这张图原创 2015-09-10 21:04:52 · 498 阅读 · 0 评论 -
Codeforces Round #329 (Div. 2)B. Anton and Lines
B. Anton and Lines time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The teacher gave Anton a large geometry h原创 2015-11-05 20:50:33 · 540 阅读 · 0 评论 -
Codeforces Round #333 (Div. 2) B. Approximating a Constant Range
B. Approximating a Constant Range time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output When Xellos was doing a p原创 2015-11-25 21:01:11 · 497 阅读 · 0 评论