Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:无耻的抄袭Fenwick Tree(树状数组)的代码

Posted by Zenomyth at 2013-09-03 11:35:10 on Problem 3468
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator