結果

問題 No.406 鴨等間隔の法則
ユーザー chacoder1
提出日時 2020-12-01 22:49:42
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 322 bytes
コンパイル時間 3,774 ms
コンパイル使用メモリ 194,332 KB
最終ジャッジ日時 2025-01-16 12:29:39
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 27 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
  int n;
  cin>>n;
  int a[n];
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  sort(a,a+n);
  int def=a[1]-a[0];
  for(int i=1;i<n-1;i++){
    if(a[i+1]-a[i] != def){
      cout<<"NO"<<endl;
      return 0;
    }
  }
  cout<<"YES"<<endl;
    
    

  return 0;
}


 
0