結果
| 問題 | No.476 正しくない平均 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-05-09 13:59:11 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 423 bytes |
| コンパイル時間 | 580 ms |
| コンパイル使用メモリ | 55,128 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-14 20:01:19 |
| 合計ジャッジ時間 | 1,849 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
#include <iostream>
using namespace std;
#define MAX_INDEX 10
typedef long long ll;
int main() {
int n;ll a;
cin >> n >> a;
int i;
ll x[MAX_INDEX], sum=0, h;
for (i = 0;i<n; i++) {
cin >> x[i];
sum += x[i];
}
if (sum % n){
cout << "NO" << endl;
return 0;
}
h = sum / n;
if (a == h) {
cout << "YES" << endl;
}
if (a != h) {
cout << "NO" << endl;
}
return 0;
}