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

why?

Posted by 20071002871 at 2009-10-18 15:19:17 on Problem 1743
void solve()
{
	
	int left=0,right=n/2,ans;


	while(left<=right)
	{
		mid=(left+right)/2;
		if(check())
			left=mid+1,ans=mid;
		else
			right=mid-1;
	}
	if(ans>=4)
	      printf("%d\n",ans+1);
	else
		printf("0\n");
}

AC,但left=4就wa,大牛们能回答下吗?


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