結果

問題 No.406 鴨等間隔の法則
ユーザー naotomannaotoman
提出日時 2018-07-25 02:34:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 189 bytes
コンパイル時間 66 ms
コンパイル使用メモリ 10,576 KB
実行使用メモリ 18,984 KB
最終ジャッジ日時 2023-09-21 18:52:32
合計ジャッジ時間 2,815 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
12,500 KB
testcase_01 AC 15 ms
7,776 KB
testcase_02 AC 14 ms
7,900 KB
testcase_03 AC 14 ms
7,864 KB
testcase_04 AC 62 ms
18,004 KB
testcase_05 AC 31 ms
11,604 KB
testcase_06 AC 32 ms
11,984 KB
testcase_07 AC 32 ms
12,048 KB
testcase_08 AC 65 ms
18,400 KB
testcase_09 AC 65 ms
18,804 KB
testcase_10 AC 34 ms
12,280 KB
testcase_11 AC 53 ms
16,456 KB
testcase_12 AC 39 ms
13,436 KB
testcase_13 AC 37 ms
12,896 KB
testcase_14 AC 76 ms
17,124 KB
testcase_15 AC 17 ms
8,820 KB
testcase_16 AC 17 ms
8,876 KB
testcase_17 AC 16 ms
8,452 KB
testcase_18 AC 17 ms
8,776 KB
testcase_19 AC 20 ms
9,000 KB
testcase_20 AC 22 ms
9,384 KB
testcase_21 AC 20 ms
9,396 KB
testcase_22 AC 30 ms
10,532 KB
testcase_23 AC 41 ms
13,672 KB
testcase_24 AC 69 ms
15,812 KB
testcase_25 AC 67 ms
18,792 KB
testcase_26 AC 92 ms
18,984 KB
testcase_27 AC 46 ms
18,900 KB
testcase_28 AC 46 ms
18,872 KB
testcase_29 AC 92 ms
18,816 KB
testcase_30 AC 92 ms
18,832 KB
testcase_31 AC 63 ms
18,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
x = list(map(int, input().split()))
x.sort()
d = x[1]-x[0]
for i in range(n-1):
    if x[i+1]-x[i] != d or d == 0:
        print('NO')
        break
else :
    print('YES')
0