問題一覧 > 通常問題

No.1944 ∞

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 110
作問者 : H20 / テスター : 蜜蜂 👑 Kazun
お気に入りにしたユーザー ProblemId : 7951 / 自分の提出
問題文最終更新日: 2022-05-21 00:43:47
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 344 (順位表) の他の問題:

Problem Statement

You have $N$ circles numbered from $1$ to $N$. The radii of the circles are $R_1, R_2, \ldots, R_N$, respectively.

You can place the circles you have on the xy-plane in any order. Determine whether it is possible to place them as follows.

  1. Place one circle centered at the origin.
  2. Place each circle from the $2$nd onward so that it has a common point with the circle placed immediately before it.※
  3. The circle placed $N$th touches the coordinates $(X,Y)$.
  4. ※ However, when placing a circle with the same radius as the previous circle, placing it so that the two coincide completely also counts as having a common point.

Input

$N\ X\ Y$
$R_1$ $R_2$ $\ldots$ $R_N$

Constraints

  • $ 1 \le N \le 2\times10^{5}$
  • $ -10^9 \le X,Y \le 10^9$
  • $ 1 \le R_i \le 10^5$
  • All inputs are integers.

Output

Print Yes if the circles can be placed so that the circle placed $N$th touches the coordinates $(X,Y)$, and No otherwise.

Print a newline at the end.

Sample

Sample 1
Input
4 8 3
1 2 3 1
Output
Yes

For example, the following placement is possible.

Sample 2
Input
3 100 0
3 4 2
Output
No

No matter how the circles are placed, the circle placed $3$rd can never touch $(100,0)$.

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

For example, the following placement is possible.

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