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:跪拜求挑错,谢……

Posted by JackyZ at 2010-08-26 14:34:15 on Problem 2187 and last updated at 2010-08-26 14:37:23
In Reply To:跪拜求挑错,谢…… Posted by:zhangsiliang880622 at 2010-08-24 10:55:13
> void convex(poly a,poly &b){
> 	b.n=0;
> 	sort(a.p,a.p+a.n);
> 	for(int i=0;i<a.n;++i){
> 		while(b.n>1&&cross(a.p[i],b.p[b.n-2],b.p[b.n-1])<0)--b.n;
                                                                <=0 把共线的去掉 否则要影响旋转卡壳的正确性 如果你直接枚举凸包 就不会wa
去掉共线的后可以证明旋转卡壳只需要比较ans=max(ans,dist(a.p[p],a.p[q]))就可以了 平行的情况会在对面被解决
> 		b.p[b.n++]=a.p[i];
> 	}
> 	int k=b.n;
> 	for(int i=a.n-2;i>=0;--i){
> 		while(b.n>k&&cross(a.p[i],b.p[b.n-2],b.p[b.n-1])<0)--b.n;
> 		b.p[b.n++]=a.p[i];
> 	}
> 	if(b.n>1)--b.n;
> 		b.p[b.n]=b.p[0];
> }


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