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 gavinmok at 2006-10-29 09:59:15 on Problem 2590
sub=y-x;
if(sub<4)cout<<sub<<endl;
else
{
	sq=(int)sqrt(sub);
	if(sq*sq==sub){cout<<2*sq-1<<endl;continue;}
	else
	{
		if(sub>sq*sq+(2*sq+1)/2)cout<<2*sq+1<<endl;
		else cout<<2*sq<<endl;
	}
}

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