結果

問題 No.1586 Equal Array
ユーザー Narumisakakios
提出日時 2021-07-08 23:20:02
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 46 ms / 1,000 ms
コード長 352 bytes
コンパイル時間 1,575 ms
コンパイル使用メモリ 167,968 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-01 13:13:25
合計ジャッジ時間 2,967 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
    ll N;cin>>N;
    vector<int>A(N);
    ll ans = 0;
    rep(i,N){
        cin>>A[i];
        ans += (A[0]-A[i])%1000000000;
    }
    if(ans%N==0)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    //cout<<ans<<endl;
}
0