結果
| 問題 | 
                            No.1586 Equal Array
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-07-09 18:12:26 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 16 ms / 1,000 ms | 
| コード長 | 349 bytes | 
| コンパイル時間 | 506 ms | 
| コンパイル使用メモリ | 63,232 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-01 14:02:06 | 
| 合計ジャッジ時間 | 1,591 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 20 | 
ソースコード
#include<iostream>
using namespace std;
typedef long long ll;
const int N = 1e5+10;
ll sum;
int a[N];
int main()
{
    ios::sync_with_stdio(false);
    cout.tie(0);
    int n;
    cin>>n;
    for(int i = 0;i<n;i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    if(sum%n == 0)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    
    return 0;
}