結果

問題 No.406 鴨等間隔の法則
ユーザー zbxahzbxah
提出日時 2018-03-08 17:30:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 271 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 10,512 KB
実行使用メモリ 19,152 KB
最終ジャッジ日時 2023-09-21 18:45:28
合計ジャッジ時間 3,418 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
13,100 KB
testcase_01 AC 15 ms
7,856 KB
testcase_02 AC 17 ms
7,764 KB
testcase_03 AC 16 ms
7,836 KB
testcase_04 AC 103 ms
17,892 KB
testcase_05 AC 48 ms
12,412 KB
testcase_06 AC 49 ms
12,380 KB
testcase_07 AC 50 ms
12,544 KB
testcase_08 AC 102 ms
18,480 KB
testcase_09 AC 111 ms
18,716 KB
testcase_10 AC 54 ms
12,928 KB
testcase_11 AC 87 ms
16,408 KB
testcase_12 AC 62 ms
13,456 KB
testcase_13 AC 59 ms
13,056 KB
testcase_14 AC 93 ms
16,940 KB
testcase_15 AC 19 ms
8,812 KB
testcase_16 AC 22 ms
9,588 KB
testcase_17 AC 18 ms
8,708 KB
testcase_18 AC 21 ms
9,548 KB
testcase_19 AC 22 ms
9,152 KB
testcase_20 AC 25 ms
9,340 KB
testcase_21 AC 27 ms
10,112 KB
testcase_22 AC 34 ms
10,516 KB
testcase_23 AC 66 ms
13,876 KB
testcase_24 AC 79 ms
16,244 KB
testcase_25 AC 111 ms
18,816 KB
testcase_26 AC 104 ms
19,152 KB
testcase_27 AC 84 ms
19,096 KB
testcase_28 AC 86 ms
18,944 KB
testcase_29 AC 105 ms
19,056 KB
testcase_30 AC 106 ms
18,864 KB
testcase_31 AC 106 ms
18,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, xs = input(), [int(i) for i in input().split(' ')]
xs.sort()  # 昇順に並べる
distances = set()  # 距離
for i, x in enumerate(xs):
    if i != len(xs) - 1:
        distances.add(xs[i + 1] - x)
print('YES' if len(distances) == 1 and 0 not in distances else 'NO')
0