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 |
写点思路吧~ 旋转卡壳的思想我用向量控制旋转的~ 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator