"Bzoj 1121" [POI2008] Laser emitter SZK

Source: Internet
Author: User

1121: [POI2008] Laser emitter szk time limit: ten Sec Memory Limit: 162 MB
Submit: 549 Solved: 455
[Submit] [Status] Description

Polygon adjacent edge vertical, edge length is an integer, edge parallel axis. To place some laser emitters and receivers on the point of the polygon. The following requirements are met: 1 the transmitter and receiver cannot be placed at the same point; 2 the emitter emits a laser that can be reflected along the wall and eventually reach a receiver; 3 the emitter can only emit lasers along the angular line. How many pairs of transmitters and receivers can be placed? Points 4<=n<=100000

Input

The first line gives a number n, which represents how many points there are. The following n lines are used to describe the coordinates of a point. Its value in [ -1000000,1000000]

Output

Maximum number of transmitters and receivers to be placed

Sample Input10
1 1
3 1
3-2
-3-2
-3 0
-1 0
-1-1
2-1
2 0
1 0
Sample Output5HINT

Thank Yyd Daniel for his contribution.


Depending on the incident light and the path of the reflected light, if two points of light are fired at the same time, then the light emitted by this point will have two paths, which is illogical, so a point is bound to be one by one corresponding to the point where he is shot.


So the answer is N/2.


#include <iostream> #include <cstring> #include <cstdio> #include <algorithm> #include < Cstdlib>using namespace Std;int main () {int n;        scanf ("%d", &n);p rintf ("%d\n", n>>1); return 0;}


"Bzoj 1121" [POI2008] Laser emitter SZK

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.