結果
問題 |
No.406 鴨等間隔の法則
|
ユーザー |
![]() |
提出日時 | 2016-08-16 09:16:29 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 434 bytes |
コンパイル時間 | 1,685 ms |
コンパイル使用メモリ | 170,912 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 05:22:28 |
合計ジャッジ時間 | 3,638 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 21 WA * 8 |
ソースコード
#include <bits/stdc++.h> #define REP(i,n) for(int i = 0; i < (int)(n); ++i) using namespace std; int main() { int N; cin >> N; vector<int> x(N+1); REP(i,N) cin >> x[i]; sort(x.begin(),x.end()); int d = x[1]-x[0]; for(int i = 1; i < N; i++){ if(x[i]-x[i-1] != d || x[i]-x[i-1] == 0){ cout << "NO" << endl; exit(0); } } cout << "YES" << endl; return 0; }