問題一覧 > 通常問題

No.998 Four Integers

レベル : / AI推定難易度 : 115 / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 613
作問者 : tsutaj / テスター : tempura_pp
お気に入りにしたユーザー ProblemId : 3954 / 自分の提出
問題文最終更新日: 2020-02-27 22:17:27
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 239 (順位表) の他の問題:

Problem Statement

You are given $4$ non-negative integers $A, B, C, D$. Determine whether they can be rearranged to form $4$ consecutive integers.

Here, $4$ integers $X < Y < Z < W$ are said to be "consecutive" if $Y = X+1, Z = Y+1, W = Z+1$ all hold.

Input

$A$ $B$ $C$ $D$
  • All inputs are given as integers.
  • $0 \leq A, B, C, D \leq 100$

Output

If the given $4$ integers can be rearranged to form $4$ consecutive integers, print Yes. Otherwise, print No.

Do not forget to print a newline at the end of the output.

Sample

Sample 1
Input
3 1 2 4
Output
Yes

The input can be rearranged into 1 2 3 4, which are $4$ consecutive integers.

Sample 2
Input
0 2 2 4
Output
No

No matter how they are rearranged, they cannot form $4$ consecutive integers.

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