問題一覧 > スコア問題

No.5009 Draw A Convex Polygon

レベル : / 実行時間制限 : 1ケース 2.600秒 / メモリ制限 : 512 MB / リアクティブ問題 (詳しくはこちら)
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 90
作問者 : harurun / テスター : yuusanlondon
お気に入りにしたユーザー ProblemId : 8797 / 自分の提出
問題文最終更新日: 2022-12-01 23:47:37
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
Advent Calendar Contest 2022 (順位表) の他の問題:

Although this is labeled as a reactive problem, it is a special judge problem. Multiple solutions exist.

Problem Statement

Choose any one integer $N$ satisfying at least $3$ and at most $10^6$, and construct on the xy-plane a strictly convex $N$-gon with $N$ vertices on its boundary.

However, all of the following conditions must be satisfied.

  • The coordinates $(x_i,y_i)$ of each vertex satisfy $-10^9≤x_i,y_i≤10^9$ and are both integers.
  • For three consecutive adjacent vertices $p_i,p_j,p_k$ in order, point $p_j$ does not lie on the line segment connecting point $p_i$ and point $p_k$.
  • No two distinct vertices coincide.

Pay attention to the output format.

Input

There is no input.

Output

$N$
$x_1\ y_2$
$\vdots$
$x_N\ y_N$

First, output the chosen $N$ on the first line.

Next, output the vertices on $N$ lines in counterclockwise order.

On line $i+1$, output the $i$-th vertex $(x_i,y_i)$ in counterclockwise order, separated by a space.

If the output does not follow the format, the behavior of the judge is undefined. It may not be judged as correct.

Due to the way the judge works, spaces and newlines are distinguished. Outputs such as printing everything on one line separated by spaces will be judged as incorrect.

Also, be sure to print a newline at the end and be sure to flush.

Score

The chosen $N$ is your score.

If $3≤N≤10^6$ is not satisfied, the output will be judged as incorrect.

Notes

For score problems, you must wait 5 minutes between submissions.

Due to yukicoder's specifications, only up to 20MB can be output, but this is avoided by using a reactive judge.

Therefore, the execution time limit includes the time taken by the judge. The judge takes up to about 600 milliseconds, so the effective execution time limit is 2 seconds.

To measure execution time, please use the online execution feature. Speeds may differ from other environments.

Since the output is large, we recommend using a fast language.

If you find a case that is wrongly accepted due to a flaw in the judge, please tell us "what kind of case gets accepted" via the question feature. (We would appreciate it if you could also tell us how to fix it.)

There is no system test, but rejudging may take place due to flaws in the judge or similar reasons, so your score may change depending on your implementation. Please be aware of this.

Sample Output

Sample Output 1
Output
3
0 0
1 0
0 1

The score is 3 points.

Sample Output 2
Output
6
-3 4
-3 1
0 0
3 1
3 4
0 5

You may start from any vertex as long as the order is counterclockwise. With this output, you get 6 points.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。