結果

問題 No.406 鴨等間隔の法則
ユーザー tookunn_1213tookunn_1213
提出日時 2016-08-05 23:41:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 225 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 10,772 KB
実行使用メモリ 19,156 KB
最終ジャッジ日時 2023-09-21 17:51:34
合計ジャッジ時間 3,317 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
12,656 KB
testcase_01 AC 17 ms
7,876 KB
testcase_02 AC 15 ms
7,744 KB
testcase_03 AC 16 ms
7,900 KB
testcase_04 AC 69 ms
17,916 KB
testcase_05 AC 33 ms
11,600 KB
testcase_06 AC 35 ms
12,040 KB
testcase_07 AC 36 ms
12,084 KB
testcase_08 AC 69 ms
18,356 KB
testcase_09 AC 72 ms
18,928 KB
testcase_10 AC 37 ms
12,476 KB
testcase_11 AC 58 ms
16,456 KB
testcase_12 AC 43 ms
13,416 KB
testcase_13 AC 41 ms
13,092 KB
testcase_14 AC 97 ms
17,096 KB
testcase_15 AC 17 ms
8,744 KB
testcase_16 AC 19 ms
8,896 KB
testcase_17 AC 17 ms
8,452 KB
testcase_18 AC 18 ms
8,776 KB
testcase_19 AC 23 ms
9,116 KB
testcase_20 AC 26 ms
9,352 KB
testcase_21 AC 22 ms
9,256 KB
testcase_22 AC 35 ms
10,472 KB
testcase_23 AC 44 ms
13,864 KB
testcase_24 AC 85 ms
16,276 KB
testcase_25 AC 73 ms
18,932 KB
testcase_26 AC 117 ms
19,148 KB
testcase_27 AC 50 ms
18,976 KB
testcase_28 AC 49 ms
19,048 KB
testcase_29 AC 116 ms
19,156 KB
testcase_30 AC 114 ms
18,852 KB
testcase_31 AC 70 ms
18,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
x = [int(i) for i in input().split()]
x.sort()
s = x[1] - x[0]
flag = True
for i in range(N - 1):
	if x[i + 1] == x[i] or x[i + 1] - x[i] != s:
		flag = False
		break
if flag:
	print("YES")
else:
	print("NO")
0