No.476 Incorrect Average
レベル :
/ AI推定難易度 : 106
/ 実行時間制限 : 1ケース 2.000秒 / メモリ制限
: 128 MB / 標準ジャッジ問題
タグ : / 解いたユーザー数 689
作問者 :
mai
タグ : / 解いたユーザー数 689
作問者 :
問題文最終更新日: 2020-04-18 09:44:15
English (AI translation)
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 155
(順位表)
の他の問題:
Problem Statement
There is a sequence $x_1,x_2,...,x_n$ consisting of $n$ elements, whose $i$-th element is $x_i$.
Mai calculated the average by hand and obtained $a$.
Is this result correct? Output YES if it is correct, and NO if it is wrong.
Input
$n$ $a$ $x_1$ $x_2$ $...$ $x_n$
$1 \le n \le 10$
$0 \le x_i \le 10^9$
$0 \le a \le 10^9$
$n,a,x_i$ are all integers.
Output
Output YES if the average of $x_1,x_2,...,x_n$ is equal to $a$, and NO otherwise.
Print a newline at the end.
Sample
Sample 1
Input
3 5 4 5 6
Output
YES
Since $\frac{4+5+6}{3} = 5$, they are equal.
Sample 2
Input
4 5 2 3 7 9
Output
NO
Since $\frac{2+3+7+9}{4} = 5.25$, they are not equal.
Sample 3
Input
10 141006540 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
Output
NO
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。