問題一覧 > 通常問題

No.3218 Night Equation

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 95
作問者 : nauclhlt / テスター : 👑 p-adic
お気に入りにしたユーザー ProblemId : 12371 / 自分の提出
問題文最終更新日: 2025-07-28 22:46:58
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 476 (順位表) の他の問題:

Story

"So it was you all along who were stopping the night..."

Problem Statement

In a certain world, the night has been lasting for an eternity because of the Spell of Everlasting Night.

There is a polynomial $f(x)=A_1x^N+A_2x^{N-1}+\cdots+A_Nx-1$. If there exists a positive real number $t$ satisfying $f(t)=0$, the night ends at time $t$. If no such number exists, the night does not end.

Determine whether dawn will come.

Input

$N$
$A_1\ A_2\ \cdots \ A_N$
  • $1\leq N\leq 10^5$
  • $0\leq A_i\leq 10^9$
  • All inputs are integers.

Output

Print Yes if the night ends, and No otherwise, on $1$ line.

Print a newline at the end.

Sample

Sample 1
Input
2
1 2
Output
Yes

We have $f(x)=x^2+2x-1$. The real numbers $t$ satisfying $f(t)=0$ are $t=-1\pm \sqrt{2}$, and since $-1+\sqrt{2}$ is positive, the night ends at time $-1+\sqrt{2}$. Therefore, the answer is Yes.

Sample 2
Input
1
0
Output
No

We have $f(x)=-1$. Thus, there is no positive real number $t$ satisfying $f(t)=0$. Therefore, the answer is No.

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