結果

問題 No.476 正しくない平均
ユーザー xxxasdfghjk
提出日時 2018-09-04 19:03:11
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 380 bytes
コンパイル時間 2,042 ms
コンパイル使用メモリ 160,060 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-15 12:52:18
合計ジャッジ時間 3,157 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
typedef long long int ll;
int main()
{
  ll n,a;
  cin >> n >> a;
  vector<int> x(n);
  REP(i,n)cin >> x[i];
  ll sum = accumulate(x.begin(),x.end(),0);
  if(sum % n != 0){
    cout << "NO" << endl;
    return 0;
  }
  sum = sum/n;
  cout << (a==sum ? "YES" : "NO") << endl;
  return 0;
}

0