#P5600. 【XR-4】尺规作图
【XR-4】尺规作图
Background
This is an output-only (human intelligence) problem.
Problem Description
You are given several known geometric objects, and you need to construct a required point using straightedge and compass. You must find this point within a limited number of steps.
You can perform the following operations:
-
Draw a circle with one known point as the center and another known point as a point on the circle.
-
Connect two known points to form a straight line.
You need to output your construction steps.
Input Format
The first line contains an integer, which is the test point ID.
The second line contains an integer , which is the number of known points.
The next lines each contain two real numbers , which are the coordinates of the -th point.
Next is an integer , which is the number of known line segments.
The next lines each contain two integers , meaning there is a line segment connecting point and point .
Next is an integer , which is the number of known lines.
The next lines each contain two integers , meaning there is a line passing through point and point .
Next is an integer , which is the number of known circles.
The next lines each contain two integers , meaning there is a circle centered at point , with point on the circle.
Next are two real numbers , which are the coordinates of the required point.
Next are integers to , which are the scoring parameters for this test point. See the statement for details.
Output Format
The first line contains an integer , which is the number of steps you need.
The next lines describe your construction steps:
First an integer or . means you draw a circle, and means you draw a straight line.
Then four real numbers :
If you draw a circle, it means you draw a circle centered at and with as a point on the circle.
If you draw a line, it means you connect and .
2
0.0000000000 0.0000000000
0.0000000000 1.0000000000
1
1 2
0
0
0.8660254038 0.5000000000
11 10 9 8 7 6 5 4 3 2
2
1 0.0000000000 0.0000000000 0.0000000000 1.0000000000
1 0.0000000000 1.0000000000 0.0000000000 0.0000000000
Hint
For each test point, if your number of steps is less than or equal to the first scoring parameters, then you will get points.
Notes:
-
All must be points you have already obtained. “Already obtained” means points from the input, or intersection points of known geometric objects. (That is, you cannot choose an arbitrary point to construct with, and you cannot obtain the required point by choosing some suitable point.)
More precisely, each time you output a coordinate, the Special Judge will choose, among all points you have currently obtained, the point whose Euclidean distance to your input coordinate is the smallest, as the point you selected this time. If this smallest distance is greater than , then this operation will be judged invalid, and for this test point you will get points. -
You cannot draw a circle from its center and radius. You can only draw a circle from its center and a point on the circle.
-
Your constructed answer is considered correct if the absolute error or relative error to the required point is at most (because the author does not know how to write a Special Judge with no error).
More precisely, suppose the point you obtained is and the required point is . Then your output is considered correct if and only if and . -
The provided files
data1.intodata10.inare the input datasets. Among them, test points come with diagrams. -
The provided checker can compute your score. Usage is as follows (where
data.inis the input file anddata.outis your output file.):
- Windows-32/64:
checker data.in data.out data.out
- Linux/MacOS:
./checker data.in data.out data.out
- The problem setter cannot get points.
update: You can click here to view the checker source code. If you have ideas for improvements, feel free to suggest them.
Translated by ChatGPT 5