結果

問題 No.406 鴨等間隔の法則
ユーザー th90tk297
提出日時 2017-11-29 17:50:36
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 293 bytes
コンパイル時間 682 ms
コンパイル使用メモリ 73,228 KB
最終ジャッジ日時 2025-01-05 04:32:13
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 27 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int n; cin >> n;
	long long a[114514]; for (int i = 0; i < n; i++)cin >> a[i]; sort(a, a + n);
	for (int i = 1; i < n - 1; i++)if (a[i] - a[i - 1] != a[i + 1] - a[i]) {
		cout << "NO\n"; return 0;
	}
	cout << "YES\n";
}
0