結果

問題 No.406 鴨等間隔の法則
ユーザー NoNo
提出日時 2017-05-16 01:28:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 241 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 19,500 KB
最終ジャッジ日時 2023-09-21 18:28:46
合計ジャッジ時間 2,834 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
12,568 KB
testcase_01 AC 15 ms
7,796 KB
testcase_02 AC 15 ms
7,792 KB
testcase_03 AC 14 ms
7,860 KB
testcase_04 AC 63 ms
18,220 KB
testcase_05 AC 31 ms
11,888 KB
testcase_06 AC 32 ms
11,876 KB
testcase_07 AC 32 ms
12,072 KB
testcase_08 AC 66 ms
18,512 KB
testcase_09 AC 68 ms
19,308 KB
testcase_10 AC 35 ms
12,668 KB
testcase_11 AC 54 ms
16,764 KB
testcase_12 AC 43 ms
13,776 KB
testcase_13 AC 37 ms
13,220 KB
testcase_14 AC 75 ms
17,496 KB
testcase_15 AC 16 ms
8,880 KB
testcase_16 AC 17 ms
8,864 KB
testcase_17 AC 16 ms
8,476 KB
testcase_18 AC 17 ms
8,808 KB
testcase_19 AC 19 ms
9,164 KB
testcase_20 AC 22 ms
9,556 KB
testcase_21 AC 21 ms
9,596 KB
testcase_22 AC 29 ms
10,412 KB
testcase_23 AC 41 ms
13,964 KB
testcase_24 AC 69 ms
16,232 KB
testcase_25 AC 66 ms
19,408 KB
testcase_26 AC 89 ms
19,500 KB
testcase_27 AC 46 ms
18,892 KB
testcase_28 AC 47 ms
19,448 KB
testcase_29 AC 89 ms
19,356 KB
testcase_30 AC 86 ms
19,256 KB
testcase_31 AC 64 ms
18,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input().split()
x = list(map(int,s))
x.sort()
sa = x[1] - x[0]

a = "YES"
if sa == 0:
   a = "NO"
else:
    for i in range(1,len(x) -1):
        if sa != x[i + 1] - x [i]:
            a = "NO"
            break

print(a)
0