結果
| 問題 |
No.476 正しくない平均
|
| ユーザー |
Kurichan0806
|
| 提出日時 | 2017-11-01 14:42:26 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 367 bytes |
| コンパイル時間 | 765 ms |
| コンパイル使用メモリ | 74,052 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-22 14:33:01 |
| 合計ジャッジ時間 | 1,825 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
using namespace std;
int main(void) {
long long int n, a, x, ans = 0;
cin >> n >> a;
for (int i = 0; i < n; i++) {
cin >> x;
ans += x;
}
if (ans / n == a && ans % n == 0) cout << "YES" << endl;
else cout << "NO" << endl;
return 0;
}
Kurichan0806