結果

問題 No.406 鴨等間隔の法則
ユーザー R NR N
提出日時 2020-11-11 11:31:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 178 ms / 2,000 ms
コード長 342 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 10,764 KB
実行使用メモリ 23,680 KB
最終ジャッジ日時 2023-09-30 00:26:19
合計ジャッジ時間 5,268 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,148 KB
testcase_01 AC 19 ms
8,524 KB
testcase_02 AC 19 ms
8,664 KB
testcase_03 AC 20 ms
8,528 KB
testcase_04 AC 166 ms
22,484 KB
testcase_05 AC 65 ms
14,332 KB
testcase_06 AC 67 ms
14,512 KB
testcase_07 AC 70 ms
14,560 KB
testcase_08 AC 160 ms
23,624 KB
testcase_09 AC 174 ms
23,488 KB
testcase_10 AC 74 ms
15,204 KB
testcase_11 AC 135 ms
18,292 KB
testcase_12 AC 93 ms
16,976 KB
testcase_13 AC 89 ms
16,528 KB
testcase_14 AC 145 ms
18,824 KB
testcase_15 AC 24 ms
9,264 KB
testcase_16 AC 26 ms
9,628 KB
testcase_17 AC 23 ms
9,320 KB
testcase_18 AC 27 ms
9,852 KB
testcase_19 AC 30 ms
9,892 KB
testcase_20 AC 34 ms
10,656 KB
testcase_21 AC 36 ms
10,712 KB
testcase_22 AC 50 ms
12,956 KB
testcase_23 AC 95 ms
17,408 KB
testcase_24 AC 117 ms
18,808 KB
testcase_25 AC 178 ms
23,680 KB
testcase_26 AC 160 ms
23,576 KB
testcase_27 AC 109 ms
19,460 KB
testcase_28 AC 122 ms
23,636 KB
testcase_29 AC 159 ms
23,644 KB
testcase_30 AC 169 ms
23,472 KB
testcase_31 AC 169 ms
23,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding=utf-8:
import collections

n = int(input())
line = list(map(int, input().split()))

line.sort()

c = collections.Counter(line)
d = c.values()

i = 0
k = list()

while i != len(line) - 1:
    k.append(line[i+1] - line[i])
    i += 1

if max(d) >= 2:
    print("NO")
elif k.count(k[0]) != len(k):
    print("NO")
else:
    print("YES")
0