結果
| 問題 |
No.476 正しくない平均
|
| ユーザー |
rapurasu
|
| 提出日時 | 2017-03-10 16:02:56 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 447 bytes |
| コンパイル時間 | 1,356 ms |
| コンパイル使用メモリ | 158,936 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-24 07:52:28 |
| 合計ジャッジ時間 | 2,167 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
#define INF 1000000000
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
typedef long long LL;
int N;
LL x[100];
LL a;
int main(){
cin>>N>>a;
LL ans=0;
REP(i,N){
cin>>x[i];
ans+=x[i];
}
if(ans%N==0){
if(ans/N==a){
cout<<"YES"<<endl;
}else{
cout<<"NO"<<endl;
}
}else{
cout<<"NO"<<endl;
}
return 0;
}
rapurasu