Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:无耻的抄袭Fenwick Tree(树状数组)的代码In Reply To:无耻的抄袭Fenwick Tree(树状数组)的代码 Posted by:Zenomyth at 2013-09-03 11:29:39 读代码提示: 在l和r中间加v后对总和的影响: [mul] right: -v + v = 0 left; + 0 middle: v [add] right: + r * v - (l - 1) * v = (r - l + 1) * v left: + 0 middle: - (l - 1) * v [total] right: idx * 0 + (r - l + 1) * v = (r - l + 1) * v left: 0 + 0 middle: idx * v - (l - 1) * v = (idx - l + 1) * v Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator