結果

問題 No.406 鴨等間隔の法則
ユーザー fumofumofunifumofumofuni
提出日時 2022-01-29 01:14:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 178 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 10,724 KB
実行使用メモリ 19,164 KB
最終ジャッジ日時 2023-08-29 00:42:24
合計ジャッジ時間 5,147 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
12,508 KB
testcase_01 AC 16 ms
7,832 KB
testcase_02 AC 16 ms
8,228 KB
testcase_03 AC 17 ms
8,084 KB
testcase_04 AC 72 ms
18,004 KB
testcase_05 AC 34 ms
11,604 KB
testcase_06 AC 34 ms
11,980 KB
testcase_07 AC 35 ms
12,080 KB
testcase_08 AC 64 ms
18,368 KB
testcase_09 AC 70 ms
18,760 KB
testcase_10 AC 36 ms
12,260 KB
testcase_11 AC 58 ms
16,528 KB
testcase_12 AC 42 ms
13,588 KB
testcase_13 AC 40 ms
13,084 KB
testcase_14 AC 90 ms
17,100 KB
testcase_15 AC 18 ms
8,736 KB
testcase_16 AC 20 ms
8,872 KB
testcase_17 AC 18 ms
8,480 KB
testcase_18 AC 18 ms
9,040 KB
testcase_19 AC 22 ms
9,104 KB
testcase_20 AC 24 ms
9,340 KB
testcase_21 AC 21 ms
9,372 KB
testcase_22 AC 32 ms
10,580 KB
testcase_23 AC 44 ms
13,876 KB
testcase_24 AC 79 ms
15,908 KB
testcase_25 AC 70 ms
18,876 KB
testcase_26 AC 107 ms
19,140 KB
testcase_27 AC 48 ms
19,164 KB
testcase_28 AC 48 ms
18,868 KB
testcase_29 AC 108 ms
18,980 KB
testcase_30 AC 103 ms
18,852 KB
testcase_31 AC 67 ms
18,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
A.sort()
d=-1
for i in range(N-1):
	if i:
		if d!=A[i+1]-A[i] or d==0:
			print('NO')
			exit()
	else:
		d=A[1]-A[0]
print('YES')
0