結果

問題 No.406 鴨等間隔の法則
ユーザー nisizawanisizawa
提出日時 2017-12-02 22:05:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 219 bytes
コンパイル時間 126 ms
コンパイル使用メモリ 10,620 KB
実行使用メモリ 18,932 KB
最終ジャッジ日時 2023-09-21 18:41:24
合計ジャッジ時間 3,245 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
12,604 KB
testcase_01 AC 15 ms
7,860 KB
testcase_02 AC 16 ms
7,756 KB
testcase_03 AC 15 ms
7,780 KB
testcase_04 AC 69 ms
17,956 KB
testcase_05 AC 33 ms
11,716 KB
testcase_06 AC 35 ms
11,904 KB
testcase_07 AC 34 ms
11,916 KB
testcase_08 AC 65 ms
18,400 KB
testcase_09 AC 70 ms
18,700 KB
testcase_10 AC 37 ms
12,512 KB
testcase_11 AC 58 ms
16,336 KB
testcase_12 AC 41 ms
13,476 KB
testcase_13 AC 40 ms
12,968 KB
testcase_14 AC 97 ms
17,088 KB
testcase_15 AC 17 ms
8,824 KB
testcase_16 AC 18 ms
8,828 KB
testcase_17 AC 17 ms
8,548 KB
testcase_18 AC 17 ms
8,752 KB
testcase_19 AC 23 ms
9,064 KB
testcase_20 AC 26 ms
9,468 KB
testcase_21 AC 22 ms
9,492 KB
testcase_22 AC 34 ms
10,372 KB
testcase_23 AC 44 ms
13,764 KB
testcase_24 AC 81 ms
15,908 KB
testcase_25 AC 72 ms
18,788 KB
testcase_26 AC 111 ms
18,792 KB
testcase_27 AC 51 ms
18,932 KB
testcase_28 AC 51 ms
18,876 KB
testcase_29 AC 108 ms
18,900 KB
testcase_30 AC 109 ms
18,780 KB
testcase_31 AC 69 ms
18,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
x = sorted([int(i) for i in input().split()])

for i in range(n - 1):
    nd = x[i + 1] - x[i]
    if nd == 0 or (i != 0 and d != nd):
        print('NO')
        break
    d = nd
else:
    print('YES')
0