問題一覧 > 通常問題

No.512 Magical Girls' Game of Tag

レベル : / AI推定難易度 : 151 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 362
作問者 : koba-e964 / テスター : Nasatame
お気に入りにしたユーザー ProblemId : 1433 / 自分の提出
問題文最終更新日: 2026-06-25 01:04:50
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 163 (順位表) の他の問題:

Problem Statement

The magical girl koba and her master were playing a game of tag. koba runs at $X$ km/h and her master runs at $Y$ km/h. Since the master is faster ($X < Y$), koba is chasing the master.
Along the road the master runs, there are $N$ intersections located at points $A_i$ m ($1 \le i \le N$) from the starting point (measured along the master's route). If (and only if) the master has already passed the next intersection ahead at the moment koba arrives at an intersection, koba loses sight of the master.
Given that koba and the master start at the same time, determine whether koba can keep chasing the master without losing sight of her up to the $N$-th (last) intersection.

Input

$X$ $Y$
$N$
$A_1$ $\cdots$ $A_N$

$1 \le X < Y \le 100$
$1 \le N \le 80$
$0 < A_1 < A_2 < \cdots < A_N \le 100000 = 10^5$
$X$, $Y$, $N$, and each $A_i$ are integers.

Output

Output "YES" if koba can keep chasing the master, or "NO" if she loses sight of the master along the way. (Do not include the quotation marks.)
Print a newline at the end.

Sample

Sample 1
Input
36 72
3
4 7 10
Output
NO

koba runs at 36 km/h = 10 m/s and the master runs at 72 km/h = 20 m/s. After the two start running, when koba reaches the first intersection 0.4 seconds later, the master has already run 8 m and is 1 m past the second intersection. koba has lost sight of the master.

Sample 2
Input
10 20
3
2 4 8
Output
YES

When koba reaches the first intersection, the master just reaches the second intersection. Note that koba does not lose sight of the master in this case.

Sample 3
Input
36 40
5
4 5 6 7 8
Output
YES

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