結果

問題 No.406 鴨等間隔の法則
ユーザー yomo3yomo3
提出日時 2020-02-01 00:12:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 202 bytes
コンパイル時間 129 ms
コンパイル使用メモリ 10,568 KB
実行使用メモリ 19,032 KB
最終ジャッジ日時 2023-09-21 19:12:07
合計ジャッジ時間 2,868 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
12,528 KB
testcase_01 AC 16 ms
7,868 KB
testcase_02 AC 14 ms
7,880 KB
testcase_03 AC 14 ms
7,924 KB
testcase_04 AC 61 ms
18,080 KB
testcase_05 AC 31 ms
11,668 KB
testcase_06 AC 31 ms
11,948 KB
testcase_07 AC 32 ms
11,972 KB
testcase_08 AC 63 ms
18,496 KB
testcase_09 AC 65 ms
18,812 KB
testcase_10 AC 35 ms
12,360 KB
testcase_11 AC 54 ms
16,472 KB
testcase_12 AC 39 ms
13,516 KB
testcase_13 AC 38 ms
12,948 KB
testcase_14 AC 67 ms
17,228 KB
testcase_15 AC 17 ms
8,836 KB
testcase_16 AC 18 ms
8,896 KB
testcase_17 AC 16 ms
8,504 KB
testcase_18 AC 17 ms
8,760 KB
testcase_19 AC 19 ms
9,136 KB
testcase_20 AC 22 ms
9,328 KB
testcase_21 AC 19 ms
9,364 KB
testcase_22 AC 28 ms
10,444 KB
testcase_23 AC 40 ms
13,764 KB
testcase_24 AC 60 ms
15,924 KB
testcase_25 AC 65 ms
18,856 KB
testcase_26 AC 77 ms
19,032 KB
testcase_27 AC 46 ms
18,896 KB
testcase_28 AC 45 ms
18,852 KB
testcase_29 AC 78 ms
18,908 KB
testcase_30 AC 76 ms
18,848 KB
testcase_31 AC 63 ms
18,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
x = list(map(int, input().split()))
x.sort()

ans = False
d = x[1] - x[0]
if d > 0:
    if all(x[i+1]-x[i] == d for i in range(1, n-1)):
        ans = True
print('YES' if ans else 'NO')
0