SSL1232 radar Coverage (normal)

Source: Internet
Author: User
Tags radar
Title Description

The semi-circular radar coverage with the center of the radar is multi-point radar rotatable to find the most covering number (including the boundary) sample input

25 25 3.5------radar coordinates and RADIUS
7----------points
25 28-------Point coordinates
23 27
27 27
24 23
26 23
24 29
26 29
350 200 2.0
5
350 202
350 199
350 198
348 200
352 200
995 995 10.0
4
1000 1000
999 998
990 992
1000 999
example output of 100-2.5 sample

3
4
4 Ideas

O (km^2)
first the radar range points with the Pythagorean theorem, and then each point and the center of the line as a diameter, calculate the left and right points, the number of points to be added to the diameter point.
var x,y:array[1..1000] of Longint;
  n,a,b,c:double;
M,i,j,k,l,r,mid,max:longint;
  Begin READLN (A,B,N);
      While not EOF (input) does begin READLN (m); j:=0;
          For I:=1 to M Do Begin Inc (J);
          READLN (X[j],y[j]);
        If sqrt (Sqr (a-x[j)) +sqr (B-y[j])) >n then Dec (j);
      End
      max:=0;
          For I:=1 to J do begin mid:=0;l:=0;r:=0;
              For K:=1 to J do begin c:= (y[k]-b) * (x[i]-a)-(x[k]-a) * (y[i]-b);
              If C=0 then Inc (mid);
              If C<0 then Inc (L);
            If C>0 then Inc (R);
          End
          If L+mid>max then Max:=l+mid;
        If R+mid>max then Max:=r+mid;
      End
      Writeln (max);
    READLN (A,b,n);
End
End. 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.