結果

問題 No.476 正しくない平均
ユーザー ilplrr
提出日時 2018-02-18 17:33:05
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 311 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 57,196 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-30 04:30:31
合計ジャッジ時間 1,465 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

int main()
{
    long long n, a; cin >> n >> a;
    
    long long s = 0;
    for (int i = 0; i < n; i++) {
        int b; cin >> b;
        s += b;
    }

    a *= n;
    cout << (s == a ? "YES" : "NO") << endl;

    return 0;
}
0