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

WA或者PE的注意!

Posted by q475027014 at 2015-04-13 18:57:17 on Problem 3468
if(tree[index].lazy)
{
	tree[index*2].lazy+=tree[index].lazy;
	tree[index*2+1].lazy+=tree[index].lazy;
	tree[index*2].val+=(r-l+1-(r-l+1)/2)*tree[index].lazy;
	tree[index*2+1].val+=(r-l+1)/2*tree[index].lazy;
	tree[index].lazy=0;
}
if(left<=l&&r<=right)
{
	tree[index].lazy+=val;
	tree[index].val+=(r-l+1)*val;
	return ;
}

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