标签:a10 font int ++ class strong printf amp nbsp
题意见白书,P272~273
把之前的板子拼起来就可以了
ans=(S(木板)*100/S(凸包))%
板子太长,只贴关键吧
求面积
db Area(D*R,int n){ db S=0.0; for(int i=1;i<n;i++)S+=Cross(R[i]-R[1],R[i+1]-R[1]); return S/2; }
int n,cnt=0;db S1=0.0; for(scanf("%d",&n);n--;){ db x,y,w,h,j,a; scanf("%lf%lf%lf%lf%lf",&x,&y,&w,&h,&j); D O(x,y);a=-Rad(j); R[++cnt]=O+Rotate(V(-w/2,-h/2),a); R[++cnt]=O+Rotate(V( w/2,-h/2),a); R[++cnt]=O+Rotate(V(-w/2, h/2),a); R[++cnt]=O+Rotate(V( w/2, h/2),a); S1+=w*h;
} int m=Andrew(R,cnt,A); db S2=Area(A,m); printf("%.1lf%%\n",S1*100.0/S2);
标签:a10 font int ++ class strong printf amp nbsp
原文地址:http://www.cnblogs.com/JasonCow/p/6592345.html