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

变态

Posted by 20071002871 at 2009-08-09 14:21:58 on Problem 3232
int check(__int64 mid)
{
	int i;
	__int64 total,tmp,v;
	total=(__int64)(m*mid);
	for(i=1;i<=n;i++)
	{
		v=a[i]-mid;
		if(v<=0)
			continue;
		if(v%water)
			tmp=(v/water)+1;
		else
		    tmp=v/water;
		if(tmp>mid)
		     return 0;	 
	    total-=tmp;
	    if(total<0)
	         return 0;
	}
	return 1;
}
能过
下面的始终wa。。。。
int check()
{
	int i;
	__int64 total,tmp,v;
	total=(__int64)(m*mid);
	for(i=1;i<=n;i++)
	{
		v=a[i]-mid;
		if(v<=0)
			continue;
		if(v%water)
			tmp=(v/water)+1;
		else
		    tmp=v/water;
		if(tmp>mid)
		     return 0;	 
	    total-=tmp;
	    if(total<0)
	         return 0;
	}
	return 1;
}

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