結果

問題 No.406 鴨等間隔の法則
ユーザー liny_tailliny_tail
提出日時 2020-08-10 12:30:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 244 bytes
コンパイル時間 257 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 21,868 KB
最終ジャッジ日時 2024-04-16 08:19:39
合計ジャッジ時間 4,611 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
15,292 KB
testcase_01 AC 31 ms
10,624 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 35 ms
10,752 KB
testcase_04 AC 109 ms
20,324 KB
testcase_05 AC 56 ms
14,724 KB
testcase_06 AC 59 ms
14,348 KB
testcase_07 AC 60 ms
15,524 KB
testcase_08 AC 107 ms
21,020 KB
testcase_09 AC 114 ms
21,424 KB
testcase_10 AC 63 ms
15,068 KB
testcase_11 AC 96 ms
18,948 KB
testcase_12 AC 71 ms
15,996 KB
testcase_13 AC 68 ms
15,620 KB
testcase_14 AC 102 ms
19,632 KB
testcase_15 AC 33 ms
11,264 KB
testcase_16 AC 36 ms
12,032 KB
testcase_17 AC 33 ms
11,264 KB
testcase_18 AC 36 ms
12,160 KB
testcase_19 AC 37 ms
11,776 KB
testcase_20 AC 40 ms
12,160 KB
testcase_21 AC 41 ms
12,672 KB
testcase_22 AC 48 ms
13,336 KB
testcase_23 AC 71 ms
16,484 KB
testcase_24 AC 86 ms
18,620 KB
testcase_25 AC 114 ms
21,488 KB
testcase_26 AC 111 ms
21,616 KB
testcase_27 AC 76 ms
21,744 KB
testcase_28 AC 86 ms
21,368 KB
testcase_29 AC 111 ms
21,868 KB
testcase_30 AC 108 ms
21,612 KB
testcase_31 AC 111 ms
20,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input().strip())
x = sorted([int(i) for i in input().strip().split(' ')])

lst = [(b - a) for a, b in zip(x, x[1:]) if b - a != 0]

if len(lst) != N - 1:
  print('NO')
  exit(0)

lst = list(set(lst))
print(['YES', 'NO'][len(lst) != 1])
0