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 wxfwxf328 at 2012-02-06 11:50:44 on Problem 2977
        if(x==0||y==0||z==0) ans=x*x+y*y+z*z;
        else
        {
            if(x==a) ans=min(min(sqr(x+y)+z*z,sqr(x+z)+y*y),min(sqr(c+y)+sqr(a+c-z),sqr(b+z)+sqr(a+b-y)));
            if(y==b) ans=min(min(sqr(y+x)+z*z,sqr(y+z)+x*x),min(sqr(a+z)+sqr(b+a-x),sqr(c+x)+sqr(b+c-z)));
            if(z==c) ans=min(min(sqr(z+x)+y*y,sqr(z+y)+x*x),min(sqr(a+y)+sqr(c+a-x),sqr(b+x)+sqr(c+b-y)));
        }

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