結果

問題 No.406 鴨等間隔の法則
ユーザー etale.K3etale.K3
提出日時 2020-11-04 18:38:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 219 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 10,604 KB
実行使用メモリ 21,680 KB
最終ジャッジ日時 2023-09-29 15:49:33
合計ジャッジ時間 3,213 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
15,168 KB
testcase_01 AC 15 ms
7,780 KB
testcase_02 AC 15 ms
8,088 KB
testcase_03 AC 15 ms
8,040 KB
testcase_04 AC 73 ms
20,808 KB
testcase_05 AC 35 ms
14,348 KB
testcase_06 AC 36 ms
14,180 KB
testcase_07 AC 37 ms
14,288 KB
testcase_08 AC 76 ms
20,860 KB
testcase_09 AC 78 ms
21,568 KB
testcase_10 AC 40 ms
15,108 KB
testcase_11 AC 61 ms
16,900 KB
testcase_12 AC 45 ms
14,556 KB
testcase_13 AC 43 ms
14,756 KB
testcase_14 AC 93 ms
20,368 KB
testcase_15 AC 17 ms
8,692 KB
testcase_16 AC 19 ms
9,284 KB
testcase_17 AC 17 ms
8,492 KB
testcase_18 AC 18 ms
9,612 KB
testcase_19 AC 22 ms
9,604 KB
testcase_20 AC 24 ms
9,920 KB
testcase_21 AC 22 ms
9,952 KB
testcase_22 AC 35 ms
13,116 KB
testcase_23 AC 47 ms
15,096 KB
testcase_24 AC 77 ms
15,872 KB
testcase_25 AC 78 ms
21,572 KB
testcase_26 AC 105 ms
21,496 KB
testcase_27 AC 49 ms
19,052 KB
testcase_28 AC 56 ms
21,252 KB
testcase_29 AC 103 ms
21,680 KB
testcase_30 AC 103 ms
21,468 KB
testcase_31 AC 77 ms
20,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
X = sorted(list(map(int, input().split())))

if len(X) != len(set(X)):
    print('NO')
    exit()

for i in range(N-2):
    if X[i] + X[i+2] != 2*X[i+1]:
        print('NO')
        exit()

print('YES')
0