結果

問題 No.406 鴨等間隔の法則
ユーザー c-yanc-yan
提出日時 2020-06-24 00:21:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 233 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 10,624 KB
実行使用メモリ 19,132 KB
最終ジャッジ日時 2023-09-16 20:20:50
合計ジャッジ時間 3,892 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
12,528 KB
testcase_01 AC 15 ms
8,056 KB
testcase_02 AC 15 ms
7,856 KB
testcase_03 AC 14 ms
8,112 KB
testcase_04 AC 64 ms
17,880 KB
testcase_05 AC 33 ms
11,456 KB
testcase_06 AC 31 ms
11,976 KB
testcase_07 AC 32 ms
12,040 KB
testcase_08 AC 65 ms
18,348 KB
testcase_09 AC 66 ms
18,892 KB
testcase_10 AC 35 ms
12,240 KB
testcase_11 AC 54 ms
16,572 KB
testcase_12 AC 41 ms
13,428 KB
testcase_13 AC 39 ms
13,036 KB
testcase_14 AC 80 ms
17,048 KB
testcase_15 AC 17 ms
8,732 KB
testcase_16 AC 18 ms
8,788 KB
testcase_17 AC 17 ms
8,484 KB
testcase_18 AC 18 ms
8,740 KB
testcase_19 AC 21 ms
8,976 KB
testcase_20 AC 24 ms
9,304 KB
testcase_21 AC 21 ms
9,240 KB
testcase_22 AC 30 ms
10,468 KB
testcase_23 AC 42 ms
13,784 KB
testcase_24 AC 70 ms
15,892 KB
testcase_25 AC 67 ms
18,820 KB
testcase_26 AC 92 ms
19,132 KB
testcase_27 AC 46 ms
19,072 KB
testcase_28 AC 47 ms
18,832 KB
testcase_29 AC 94 ms
18,952 KB
testcase_30 AC 90 ms
18,932 KB
testcase_31 AC 66 ms
18,600 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