結果

問題 No.476 正しくない平均
コンテスト
ユーザー uzzy
提出日時 2019-10-06 23:07:46
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 600 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,250 ms
コンパイル使用メモリ 173,092 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-28 03:39:27
合計ジャッジ時間 6,178 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 15 WA * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:27:19: warning: 'X' may be used uninitialized [-Wmaybe-uninitialized]
   27 |                 X += x;
      |                 ~~^~~~
main.cpp:23:12: note: 'X' was declared here
   23 |         ll X;
      |            ^

ソースコード

diff #
raw source code

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

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


	ll N, A;
	cin >> N >> A;
	ll X;
	rep(i, N) {
		int x;
		cin >> x;
		X += x;
	}

	if (N * A == X) co("YES");
	else co("NO");



	Would you please return 0;
}
0