結果
| 問題 |
No.476 正しくない平均
|
| ユーザー |
nsy_fuya
|
| 提出日時 | 2020-04-19 18:48:43 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 734 bytes |
| コンパイル時間 | 712 ms |
| コンパイル使用メモリ | 83,044 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-06 00:17:01 |
| 合計ジャッジ時間 | 1,762 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <numeric>
#include <set>
#include <cstdlib>
#include <queue>
#include <map>
using namespace std;
typedef long long llint;
typedef long double ld;
#define inf 1e18
#define mod 1000000007
priority_queue<llint,vector<llint>,greater<llint>> que;
//priority_queue<llint> q;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int a,n;
void solve(){
cin >> n >> a;
int x;
double ans=0;
for(int i=0;i<n;i++){
cin >> x;
ans+=x;
}
ans/=(double)n;
if(a==ans)cout << "YES";
else cout << "NO";
cout << endl;
}
int main(int argc, char *argv[]) {
solve();
return 0;
}
nsy_fuya