1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
| program bzoj_3564; uses math; const eps=1e-6; type rec=record x,y:extended; end; var p:array[1..50000]of rec; n,i,j,k,d:longint; px,py,ox,oy,r,pi,a:extended;
procedure swap(var a,b:rec); var p:rec; begin p:=a; a:=b; b:=p; end;
function dis(x1,y1,x2,y2:extended):extended; begin exit(sqrt(sqr(x1-x2)+sqr(y1-y2))); end;
procedure calc(a,b,c,d,e,f:extended); begin ox:=(b*f-e*c)/(a*e-d*b); oy:=(a*f-d*c)/(d*b-a*e); end;
begin pi:=arccos(-1); read(n); for i:=1 to n do read(p[i].x,p[i].y); read(d); a:=(-d/180)*pi; read(d); for i:=1 to n do begin px:=p[i].x; py:=p[i].y; p[i].x:=(px*cos(a)-py*sin(a))/d; p[i].y:=px*sin(a)+py*cos(a); end; randomize; for i:=n downto 2 do swap(p[i],p[random(i-1)+1]); ox:=p[1].x; oy:=p[1].y; r:=0; for i:=2 to n do if dis(p[i].x,p[i].y,ox,oy)>r+eps then begin ox:=p[i].x; oy:=p[i].y; r:=0; for j:=1 to i-1 do if dis(p[j].x,p[j].y,ox,oy)>r+eps then begin ox:=(p[i].x+p[j].x)/2; oy:=(p[i].y+p[j].y)/2; r:=dis(ox,oy,p[j].x,p[j].y); for k:=1 to j-1 do if dis(p[k].x,p[k].y,ox,oy)>r+eps then begin calc(p[i].x-p[j].x,p[i].y-p[j].y,(p[j].x-p[i].x)*(p[i].x+p[j].x)/2+(p[j].y-p[i].y)*(p[i].y+p[j].y)/2, p[k].x-p[i].x,p[k].y-p[i].y,(p[i].x-p[k].x)*(p[k].x+p[i].x)/2+(p[i].y-p[k].y)*(p[k].y+p[i].y)/2); r:=dis(ox,oy,p[k].x,p[k].y); end; end; end; writeln(r:0:3); end.
|