結果

問題 No.476 正しくない平均
ユーザー zaichu
提出日時 2017-01-28 03:13:32
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 459 bytes
コンパイル時間 682 ms
コンパイル使用メモリ 72,268 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-23 20:13:00
合計ジャッジ時間 1,637 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 17 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <queue>
using namespace std;

int sum(vector<int> d){
  int total = 0;
  for(int i = 0; i < d.size(); i++){
    total += d[i];
  }
  return total;
}

void solve() {
  int n,a;
  cin >> n >> a;
  vector<int> d(n);
  for(auto &x : d) cin >> x;
  double ave = sum(d) / n;
  cout << (ave == a ? "YES" : "NO") << endl;
}

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  solve();

  return 0;
}
0