結果

問題 No.406 鴨等間隔の法則
ユーザー kyo1
提出日時 2020-04-17 00:34:08
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 431 bytes
コンパイル時間 1,439 ms
コンパイル使用メモリ 176,808 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-03 05:10:59
合計ジャッジ時間 3,202 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 27 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  vector<int> X(N);
  for (int i = 0; i < N; i++) {
    cin >> X[i];
  }
  sort(X.begin(), X.end());
  set<int> st;
  for (int i = 0; i < N - 1; i++) {
    st.insert(abs(X[i + 1] - X[i]));
  }
  if ((int)st.size() == 1) {
    cout << "YES" << '\n';
  } else {
    cout << "NO" << '\n';
  }
  return 0;
}
0