結果

問題 No.406 鴨等間隔の法則
ユーザー J31831276
提出日時 2018-12-29 00:06:52
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 402 bytes
コンパイル時間 746 ms
コンパイル使用メモリ 59,644 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-01 15:03:53
合計ジャッジ時間 2,629 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 27 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>

#define ll long long

using namespace std;

int main(){

   int n;
   cin>>n;
   int x[100000];
   for(int i=0;i<n;++i) cin>>x[i];
   sort(x,x+n);
   int flag=1;
   int d;
   d=x[1]-x[0];
   for(int i=1;i<n-1;++i)
      if(x[i+1]-x[i]!=d) flag=0;
    
   if(flag) cout<<"YES"<<endl;
   else cout<<"NO"<<endl;

   return 0;
}
0