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 2008022118 at 2010-04-19 20:42:27 on Problem 2079
我用向量控制旋转的~
double QiaKe(Point sta[],int n)
{
    int i, p = 1, q = 2;
    sta[n] = sta[0];
    sta[n+1] = sta[1];
    sta[n+2] = sta[2];
    double temp, ans = 0;
    for (i = 0; i < n; i++)
    {
        while (Xmul(sta[i],sta[p],sta[q+1])
              -(temp=Xmul(sta[i],sta[p],sta[q])) > eps)
        q = (q+1)%n;
        ans = max(ans, temp);
        while (Xmul(sta[i],sta[p+1],sta[q])
              -(temp=Xmul(sta[i],sta[p],sta[q])) > eps) /*相等时也要结束,否则陷入死循环*/
        p = (p+1)%n;
        ans = max(ans, temp);
    }    
    return ans;
}

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