#P7558. [JOISC 2021] 曲芸飛行 (Day1)

    ID: 8420 远端评测题 1000ms 128MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>2021提交答案Special JudgeJOI(日本)

[JOISC 2021] 曲芸飛行 (Day1)

Background

This is an output-only problem.

SPJ modified by wlzhouzhuan.

Problem Description

On a 2D Cartesian coordinate plane, there are NN points (Xi,Yi)(X_i, Y_i). Xiao B starts from one point, chooses any point as the destination, walks to it along a straight-line path, and repeats this process N1N - 1 times. It is not hard to see that this will form a polyline consisting of NN line segments. For every point except the first and the last, an angle αi (2in1)\alpha_i\ (2 \le i \le n - 1) is formed (the one that is 180\le 180^\circ; ii denotes the ii-th visited point). Xiao B asks you to maximize the following expression by planning the visiting order of the points along the polyline:

mini=2n1{αi}\min\limits_{i=2}^{n-1}\{\alpha_i\}

Input Format

The first line contains two integers N,Z0N, Z_0, representing the number of points and the scoring parameter (see Constraints and Notes, and the evaluation description below).

The next NN lines each contain two integers Xi,YiX_i, Y_i, representing a point.

Output Format

Output NN lines, each containing an integer PkP_k, representing the index of the kk-th visited point.

7 90
3 1
2 5
0 2
-1 6
-3 1
-1 -4
4 -2
5
3
1
7
6
4
2

Hint

Sample 1 Explanation

As shown in the figure below:

The smallest angle is at point 66, which is 68.1985968.19859\cdots^\circ. With Z0=90Z_0 = 90 and the scoring parameter description in the evaluation method below, this output can get a score of 61.5%61.5\%.

Constraints and Notes

For 100%100\% of the testdata, 3N10003 \le N \le 1000, Xi2+Yi2107\sqrt{X_i^2 + Y_i^2} \le 10^7, no two points coincide, and 1Z01791 \le Z_0 \le 179.

In particular, this is an output-only problem, with a total of 66 test cases:

  • The input files are input_01.txt to input_06.txt.
  • The output files are output_01.txt to output_06.txt.
  • For each test case, its NN, Z0Z_0, and score are as follows:
Test case ID NN Z0Z_0 Score
11 1515 100100 1010
22 200200 143143 1515
33 134134
44 10001000 156156 2020
55 150150
66 153153

Scoring Parameters

This problem uses a Special Judge.

Thanks to @035966_L3 for providing the Special Judge.

If your output format is wrong, or the numbers you output are not in 1N1 \sim N, or there are other errors, then you are doomed.

If your output format is correct, suppose the minimum angle you obtain is ZZ. Then your score is:

  • If ZZ0Z \ge Z_0, you will get full score.
  • If Z<Z0Z < Z_0, let the score of this test case be SS, then you will get S×f(Z/180)f(Z0/180)S \times \frac{f(Z/180)}{f(Z_0/180)}.

Define the function f(α) (0α1)f(\alpha)\ (0 \le \alpha \le 1) as:

f(α)=4α4+αf(\alpha)=4\alpha^4+\alpha

Evaluation Library

We additionally provide an evaluation library (in the file aerobatics.h), which you can use to compute the angle (in degrees) formed by three points.

The calling formats are:

  • double GetAngle(int xb,int yb,int xa,int ya,int xc,int yc) or double GetAngle(int xb,int yb,int xc,int yc,int xa,int ya)
    • This function computes ABC\angle ABC, with sufficiently small error.
    • Please ensure the order is correct.
    • (xa,ya)(xa, ya) is point AA.
    • (xb,yb)(xb, yb) is point BB.
    • (xc,yc)(xc, yc) is point CC.
    • If (xa,ya)=(xb,yb)(xa, ya) = (xb, yb) or (xa,ya)=(xc,yc)(xa, ya) = (xc, yc), then, heh, hehehe.

Additional File Description

  1. Name: aerobatics-dist.zip in the attachments below.
    • in & out: sample input and output.
    • aerobatics.h: evaluation library.
  2. Name: aerobatics-data.zip in the attachments below:
    • in: input data.

Notes

Translated from The 20th Japanese Olympiad in Informatics Spring Training Camp Day1 A Aerobatics (曲芸飛行) English version.

Translated by ChatGPT 5