問題一覧 > 通常問題

No.2602 Real Collider

レベル : / AI推定難易度 : 1625 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 45
作問者 : 👑 amentorimaru / テスター : cleantted 👑 seekworser
お気に入りにしたユーザー ProblemId : 10282 / 自分の提出
問題文最終更新日: 2024-01-08 13:25:38
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
yukicoder contest 414 (順位表) の他の問題:

Problem Statement

To enjoy virtual space, it is essential to avoid collisions with objects in the real world.


Real Wanyu-kun is currently in a room on a sufficiently large two-dimensional plane. When he decides on three distinct coordinates $(X_A,Y_A),(X_B,Y_B),(X_C,Y_C)$, the circle of minimum radius containing those three points is defined as the play area.

There are currently $Q$ pieces of luggage in the room, placed at the coordinates $(X_i,Y_i)$ respectively.

Luggage inside the play area must be cleared away, so answer with Yes or No whether each piece needs to be cleared away.

For both the luggage and the coordinates defining the play area, points on the circumference are considered to be contained in the circle.

Input

$Q$
$X_A\ Y_A\ X_B\ Y_B\ X_C\ Y_C\ $
$X_1\ Y_1$
$X_2\ Y_2$
$\vdots$
$X_Q\ Y_Q$

  • All inputs are integers
  • $1\le Q \le 2\times 10^5$
  • $|X_A|,|X_B|,|X_C|,|Y_A|,|Y_B|,|Y_C|,|X_i|,|Y_i|\le 10^4$
  • $(X_A,Y_A),(X_B,Y_B),(X_C,Y_C)$ are all distinct

Output

For each of the $Q$ pieces of luggage, output Yes if it needs to be cleared away and No otherwise, separated by newlines.

Sample

Sample 1
Input
5
1 0 -1 0 0 2
0 1
0 2
0 3
2 2
0 -1
Output
Yes
Yes
No
No
No

The arrangement is shown in the figure below. $(X_A,Y_A),(X_B,Y_B),(X_C,Y_C)$ are the red points, the blue line is the play area, and the luggage locations are the green points.

$(0,1)$ is inside this circle, so output Yes.

$(0,2)$ is on the circumference, which also counts as inside this circle, so output Yes.

$(2,2)$ is not inside this circle, so output No.

Sample 2
Input
3
-1 0 0 0 1 0
0 1
0 -1
1 1
Output
Yes
Yes
No

Note that the play area is the circle of minimum radius containing the three points.

Sample 3
Input
5
0 0 6 0 0 8
6 8
7 7
7 1
-1 7
-1 1
Output
Yes
Yes
Yes
Yes
Yes

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