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

Re:2079 请管理员添加三组数据@root

Posted by shengrang at 2015-07-17 16:51:56 on Problem 2079
In Reply To:Re:2079 请管理员添加三组数据@root Posted by:szwl at 2015-01-02 23:21:21
double rotating_calipers(const point *ps, int n)
{
    double res = 0;
    int i, j, k;
    j = 1; k = 2;
    for(i=0; i<n; i++)
    {
        while((xmult(ps[j], ps[k], ps[i]) < xmult(ps[j], ps[(k+1)%n], ps[i])) || (xmult(ps[j], ps[k], ps[i]) < xmult(ps[(j+1)%n], ps[k], ps[i]))
             )
        {
        while(xmult(ps[j], ps[k], ps[i]) < xmult(ps[j], ps[(k+1)%n], ps[i]))
            k = (k+1) % n;
        while(xmult(ps[j], ps[k], ps[i]) < xmult(ps[(j+1)%n], ps[k], ps[i]))
            j = (j+1) % n;
        }
        res = max(res, xmult(ps[j], ps[k], ps[i])/2.0);
    }
    return res;
}


这么写能过你的数据..但是感觉复杂度其实不高?? 想不到证明的办法..求解答

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