結果

問題 No.476 正しくない平均
ユーザー kaito_tateyama
提出日時 2017-08-13 17:03:36
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 543 bytes
コンパイル時間 643 ms
コンパイル使用メモリ 72,660 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-13 09:09:38
合計ジャッジ時間 1,582 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
//---------------------------
using namespace std;
//---------------------------
#define REP(i,n) for(int i = 0; i < (n); i++)
#define P(x) cout << (x) << "\n"
//---------------------------


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



  long long sum=0,n,a;cin >> n >> a;
  REP(i,n){
    long long b;cin >> b;
    sum += b;
  }
  cout << (sum == n * a ? "YES" : "NO") << endl;
  P(a);
  P(sum/(double)n);

  return 0;
}
0