結果

問題 No.406 鴨等間隔の法則
ユーザー cwwcww
提出日時 2016-10-07 02:09:37
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 549 bytes
コンパイル時間 1,573 ms
コンパイル使用メモリ 175,396 KB
実行使用メモリ 8,636 KB
最終ジャッジ日時 2023-09-21 18:14:45
合計ジャッジ時間 4,035 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
5,520 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 57 ms
8,112 KB
testcase_05 AC 23 ms
5,112 KB
testcase_06 AC 23 ms
5,096 KB
testcase_07 AC 24 ms
5,084 KB
testcase_08 AC 56 ms
8,316 KB
testcase_09 AC 61 ms
8,320 KB
testcase_10 AC 26 ms
5,496 KB
testcase_11 AC 48 ms
7,272 KB
testcase_12 AC 32 ms
5,892 KB
testcase_13 AC 30 ms
5,644 KB
testcase_14 AC 46 ms
7,480 KB
testcase_15 AC 4 ms
4,376 KB
testcase_16 AC 6 ms
4,376 KB
testcase_17 AC 4 ms
4,376 KB
testcase_18 AC 6 ms
4,376 KB
testcase_19 AC 6 ms
4,380 KB
testcase_20 AC 8 ms
4,380 KB
testcase_21 AC 10 ms
4,376 KB
testcase_22 AC 13 ms
4,476 KB
testcase_23 AC 34 ms
6,024 KB
testcase_24 AC 40 ms
7,004 KB
testcase_25 AC 61 ms
8,592 KB
testcase_26 AC 56 ms
8,576 KB
testcase_27 AC 38 ms
4,380 KB
testcase_28 AC 55 ms
8,636 KB
testcase_29 AC 55 ms
8,548 KB
testcase_30 AC 54 ms
8,320 KB
testcase_31 AC 59 ms
8,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
using LL=long long;
int main()
{
	LL N;
	cin >> N;

	vector<LL> vc(N);
	for( auto &x : vc )
	{
		cin >> x;
	}

	sort( begin( vc ), end( vc ) );

	if( set<LL>( begin( vc ), end( vc ) ).size() != 1 )
	{
		vector<LL> res;
		adjacent_difference( begin( vc ), end( vc ), back_inserter( res ) );
		res.erase( res.begin() );

		if( set<LL>( begin( res ), end( res ) ).size() == 1 )
		{
			cout << "YES" << endl;
			return 0;
		}
	}
	cout << "NO" << endl;

	return 0;
}
0