Calculation of geometric questions)

Source: Internet
Author: User
Features and essentials of solving computational geometric questions:
1. Most of them won't be difficult, and a few of them have clever ideas.
2. For computational geometric questions, templates are very important and must be highly reliable.
3. Pay attention to the Code Organization, because it is easy to have two hundred lines of code on the computing geometric question, most of which are templates. If the code is messy, the correct rate of the question is seriously affected.
4. Pay attention to precision control.
5. Try to use integers where integers can be used. Think of a method to expand the data (double or expand sqrt2 ). Because integers do not have to consider floating point errors, and the operation is faster than floating point.

I. Point, line, surface, basic relationship of shape, understanding of dot product cross product

Poj 2318 toys (recommended)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2318
Poj 2398 Toy storage (recommended)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2398
A rectangle is divided into N grids by several straight lines to give the coordinates of a vertex and ask which vertex the vertex is located in.
Knowledge point: in fact, it is the judgment in the convex quadrilateral. If the cross product is used, it can be solved in two parts.

Poj 3304 segments
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3304
Knowledge Point: intersection of line segments and straight lines. Handle the overlap points during enumeration.

Poj 1269 intersecting lines
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1269
Knowledge Point: determines the intersection of a straight line and calculates the intersection point.

Poj 1556 the doors (recommended)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1556
Knowledge Point: simple graph theory + simple computation of ry, first obtain the intersection of line segments, and then use dij to find the shortest path.

Poj 2653 pick-up sticks
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2653
Knowledge Point: or line segment intersection judgment

Poj 1066 treasure hunt
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1066
Knowledge Point: determines the intersection of line segments, but you must first understand what the "minimum door" is.

Poj 1410 Intersection
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1410
Knowledge Point: The line segments and rectangles intersect. Correctly understand the definition of intersection in question meaning.
For details, see:Http://hi.baidu.com/novosbirsk/blog/item/68c682c67e8d1f1d9d163df0.html

Poj 1696 space ant (recommended)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1696
A good question for the Tehran division. Need to understand the properties of the dot product cross product

Poj 3347 kadj squares
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3347
My methods are extremely cumbersome. Complex line segment intersection problems. This topic is a typical application of geometric expansion data operations. After doubling the root number, decimal places are avoided.

Poj 2826 an easy problem ?! (Recommended)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2826
Q: How much rain can two straight lines form a graph. Easy problem is not simple. Consider all the situations. You don't want to check whether discuss can communicate with each other. (I can't do it myself) remind me that water falls vertically from the sky.

Poj 1039 Pipe
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1039
It is also the judgment of the intersection of a line segment and a straight line, plus the idea of enumeration.

Poj 3449 geometric shapes
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3449
Determines whether the ry is intersecting, but the input and output are disgusting.
In addition, there is a knowledge point, that is, to give the vertex on the two diagonal lines of a square (the edge is not parallel to the axis). You need to find the other two points. You must master the methods.

Poj 1584 a round peg in a ground hole
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1584
Knowledge Point: Point to straight line distance, circle and polygon intersection, polygon is convex

Poj 2074 line of sight (recommended)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2074
The key to solving the line-of-sight problem is to find the linear equation after two points and the intersection of the line and line segments. The data has a trick, so be careful.

II. Convex Hull

Poj 1113 Wall
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1113
Knowledge Point: naked convex bag problem, convex bag perimeter plus circumference.

Poj 2007 scrambled Polygon
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2007
Knowledge Point: convex hull, output by polar order

Poj 1873 the fortified forest (recommended)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1873
World final question, first find the convex bag, and then search. Given the small scale, bitwise enumeration can be used.
For details, see:Http://hi.baidu.com/novosbirsk/blog/item/333abd54c7f22c52574e0067.html

Poj 1228 Grandpa's estate (recommended)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1228
When finding the number of convex hull vertices, many people will find the convex hull template more points. Although the correct answer can be obtained when finding the area, there will be problems in this question. In addition, we must correctly understand the nature of the convex hull.

Poj 3348 cows
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3348
Convex Hull area calculation

3. Area and Formula

Poj 1654 Area
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1654
Knowledge Point: Use a directed area (Cross Product) to calculate the Polygon Area

Poj 1265 Area
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1265
Poj 2954 triangle
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2954
The application of the pick formula, the relationship between polygon and the whole point. (There is a GCD relationship)

4. Semi-plane intersection

The main application of the semi-plane intersection is to determine whether a polygon has a core. It can also solve some problems related to the feasible regions of the linear equations (that is, those in high school ).

Poj 3335 rotating scoreboard
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3335
Poj 3130 how I mathematician wonder what you are!
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3130
Poj 1474 video surveillance
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1474
Knowledge Point: returns the core of a polygon on a semi-plane and determines the existence of a polygon.

Poj 1279 Art Gallery
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1279
Returns the core of a polygon and the area of the core.

Poj 3525 most distant point from the sea (recommended)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3525
Returns a polygon, finding a point in it, which is the farthest from the boundary of the polygon, that is, the largest radius circle in the polygon.
You can use semi-plane intersection + bipartite solution. The distance is two points, and the side approaches inward until the precision is reached.

Poj 3384 feng shui (recommended)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3384
In the actual application of the semi-plane intersection, we use two circles to overwrite a polygon and ask at most the area that can cover the polygon.
Solution: Use the semi-plane intersection to push each side of the polygon to the "inner" to get a new polygon and then calculate the farthest two points of the polygon.

Poj 1755 Triathlon (recommended)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1755
The semi-plane intersection determines whether the inequality has a solution. Pay attention to the choice of positive and negative signs during the transformation, which directly affects the direction of the semi-plane intersection.

Poj 2540 hotter colder
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2540
The semi-plane intersection is used to calculate the area of the feasible area of linear planning.

Poj 2451 uyuw's concert
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2451
NLP is designed for his nlogn algorithm to solve the problem of semi-plane traffic.

5. In fact, the key to solving the problem is other problems (data structure, combined mathematics, or enumeration)
Several Typical discretization + scanning questions are required by ACM players

Poj 1151 Atlanta (recommended)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1151
Poj 1389 area of simple polygons
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1389
Rectangular discretization, line segment tree processing, rectangular area Intersection

Poj 1177 picture (recommended)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1177
Rectangle discretization, line segment tree processing, and the perimeter of the rectangle intersection. The data in this topic is relatively strong. The line segment tree must be efficient.

Poj 3565 ants (recommended)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3565
The adjustment idea in computational ry is a bit like sorting. The intersection of line segments is used.
For details, see:Http://hi.baidu.com/novosbirsk/blog/item/fb668cf0f362bec47931aae2.html

Poj 3695 rectangles
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3695
It is also the area of the rectangle, but because it is used for multiple queries, and there are not many rectangles, it is most suitable to solve the problem by using the Exclusion Principle in combination mathematics. A line segment tree is a general method, but there are other feasible methods besides a line segment tree.

Poj 2002 squares
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2002
Enumeration Method: calculates the maximum number of squares and hash points on a plane.

Poj 1434 fill the cisterns! (Recommended)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1434
As soon as it starts to faint, prepare a line segment tree. It is actually a simple binary.

Sat. Random Algorithm
What about poj 2420 a star not a tree?
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2420
Polygon. A Fermat point is a point P in a polygon. The sum of the distance between the point and other points is the shortest. The polygon above the Quadrilateral does not have a formula for finding the Fermat point. Therefore, you can use the Randomization Variable Step greedy method.
For details, see:Http://hi.baidu.com/novosbirsk/blog/item/75983f138499f825dd54019b.html

7. Resolution ry
I am not good at this kind of question, so I do not do much, the template is very important. Of course, it is useful to skillfully use the cross product and dot product.
Poj 1375 intervals
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1375
Knowledge Point: returns the tangent of a point outside the circle to the circle.

Poj 1329 circle through three points
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1329
Round of Triangle

Poj 2354 Titanic
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2354
Calculate the distance between two points on the sphere, and give the geographical latitude and longitude coordinates.

Poj 1106 Transmitters
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1106
The angle sorting function uses the atan function to determine the angle of the slope.

Poj 1673 exocenter of a triangle
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1673
It can be converted to the center of the triangle.

8. Rotating jamming case

Poj 2187 beauty contest
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2187
Calculate the farthest point of a convex hull. You can use brute-force enumeration or a rotating card shell.

Poj 3608 bridge communications SS islands (hard)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3608
The closest distance between two convex packets. My card shell is always wa. Depressed.

9. Other problems
Poj 1981 circle and points
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1981
How many points on the plane can be overwritten by the Unit Circle

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.