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

加个d[0] = -1 你那个二分也有问题

Posted by first at 2006-02-23 16:33:17 on Problem 2533
In Reply To:我知道了,刚刚发现我的程序过不了1 0这组数据:) Posted by:yiyiyi4321 at 2005-12-17 09:28:13
 while(left < right)
	   {
	     mid=(left+right)/2;
	     if(a[i] > d[mid])
	        left = mid+1;
	     if(a[i] < d[mid])
	         right = mid - 1;
	     if(a[i]==d[mid])
	         break;	 
	   }
	  if(a[i] < d[left])
		   d[left]=a[i];
	  else if(a[i] > d[left])
		   d[left+1]=a[i];
       }

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