結果
| 問題 |
No.476 正しくない平均
|
| ユーザー |
kichirb3
|
| 提出日時 | 2018-02-27 11:35:00 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 575 bytes |
| コンパイル時間 | 647 ms |
| コンパイル使用メモリ | 70,164 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-28 03:06:57 |
| 合計ジャッジ時間 | 1,375 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
// No.476 正しくない平均
// https://yukicoder.me/problems/no/476
//
#include <iostream>
#include <vector>
#include <numeric>
using namespace std;
string solve(vector<long> &numbers, long n, long a);
int main() {
long n, a;
cin >> n >> a;
vector<long> numbers(n);
for (auto i = 0; i < n; i++)
cin >> numbers[i];
string ans = solve(numbers, n, a);
cout << ans << endl;
}
string solve(vector<long> &numbers, long n, long a) {
long total = accumulate(numbers.begin(), numbers.end(), 0L);
return (total == n * a? "YES": "NO");
}
kichirb3