結果

問題 No.406 鴨等間隔の法則
ユーザー c-yanc-yan
提出日時 2020-07-30 03:48:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 85 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 10,664 KB
実行使用メモリ 19,156 KB
最終ジャッジ日時 2023-09-14 03:31:06
合計ジャッジ時間 3,480 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
12,540 KB
testcase_01 AC 14 ms
8,176 KB
testcase_02 AC 13 ms
7,872 KB
testcase_03 AC 13 ms
8,200 KB
testcase_04 AC 54 ms
18,020 KB
testcase_05 AC 28 ms
11,476 KB
testcase_06 AC 28 ms
11,832 KB
testcase_07 AC 30 ms
12,104 KB
testcase_08 AC 54 ms
18,392 KB
testcase_09 AC 58 ms
18,752 KB
testcase_10 AC 30 ms
12,300 KB
testcase_11 AC 47 ms
16,492 KB
testcase_12 AC 33 ms
13,556 KB
testcase_13 AC 32 ms
13,040 KB
testcase_14 AC 67 ms
17,212 KB
testcase_15 AC 16 ms
8,712 KB
testcase_16 AC 15 ms
8,964 KB
testcase_17 AC 15 ms
8,468 KB
testcase_18 AC 15 ms
8,720 KB
testcase_19 AC 17 ms
8,960 KB
testcase_20 AC 20 ms
9,312 KB
testcase_21 AC 17 ms
9,348 KB
testcase_22 AC 26 ms
10,400 KB
testcase_23 AC 37 ms
13,792 KB
testcase_24 AC 62 ms
15,976 KB
testcase_25 AC 66 ms
18,828 KB
testcase_26 AC 85 ms
18,988 KB
testcase_27 AC 41 ms
19,156 KB
testcase_28 AC 42 ms
18,928 KB
testcase_29 AC 81 ms
19,128 KB
testcase_30 AC 77 ms
18,856 KB
testcase_31 AC 55 ms
18,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
x = list(map(int, input().split()))

x.sort()
t = x[1] - x[0]

if t == 0:
    print('NO')
    exit()

for i in range(1, N - 1):
    if x[i + 1] - x[i] != t:
        break
else:
    print('YES')
    exit()
print('NO')
0