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:因为x的坐标有可能为0,如果x=0的时候你要将这个点加入的话你会发现出现了死循环

Posted by richardxx at 2007-01-01 21:42:50 on Problem 2352
In Reply To:因为x的坐标有可能为0,如果x=0的时候你要将这个点加入的话你会发现出现了死循环 Posted by:Sempr at 2007-01-01 14:47:26
> 
> while (idx<MAXN){
>     arr[idx]+=diff;
>     idx += lowBit(idx); // 如果idx=0,那么这个地方idx将永远是0
> }

哈哈,对对,非常感谢Sempr师兄的提示。

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