問題一覧 > 教育的問題

No.8024 Equation

レベル : / AI推定難易度 : 1550 / 実行時間制限 : 1ケース 5.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 18
作問者 : testestest
お気に入りにしたユーザー ProblemId : 1147 / 自分の提出
問題文最終更新日: 2026-06-28 13:26: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 April fool contest 2017 (順位表) の他の問題:

Problem Statement

Determine whether an equation can be formed from the given numbers using the four arithmetic operations and parentheses.

Input

$N$
$A_1$ $A_2$ ... $A_N$

$3\leq N \leq 7$
$1\leq A_i \leq 100$
$A_i$ are distinct integers.

Output

Output $YES$ if an equation can be formed, and $NO$ otherwise.

Sample

Sample 1
Input
4
1 2 3 4
Output
YES

$1+2=3$
You do not need to use all of the numbers.

Sample 2
Input
3
1 2 4
Output
NO

The same number cannot be used more than once.

Sample 3
Input
6
63 65 37 57 89 99
Output
YES

$(65-63)*(99-89)=57-37$ is one example.

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