| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
问题在哪?In Reply To:用弗洛伊德才过,真是没法了…… Posted by:Isun at 2008-06-10 04:31:16 // 从a点沿逆时针走到b点的最小距离
double med(int a, int b)
{
if (a > b)
b += n;
double ret = 0;
top = 0;
stk[top++] = P[a%n];
for (int i = a+1; i <= b; i++)
{
while (top > 1 && cpr(stk[top-2], stk[top-1], P[i%n]) < -eps)
top--;
stk[top++] = P[i%n];
}
for (int i = 0; i < top-1; i++)
ret += dis(stk[i], stk[i+1]);
return ret;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator