結果

問題 No.406 鴨等間隔の法則
ユーザー OhnumaOhnuma
提出日時 2020-04-10 10:00:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 230 ms
コンパイル使用メモリ 10,528 KB
実行使用メモリ 21,692 KB
最終ジャッジ日時 2023-10-12 19:33:23
合計ジャッジ時間 4,323 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
15,272 KB
testcase_01 AC 16 ms
7,776 KB
testcase_02 AC 16 ms
7,756 KB
testcase_03 AC 16 ms
7,820 KB
testcase_04 AC 78 ms
20,876 KB
testcase_05 AC 37 ms
14,308 KB
testcase_06 AC 38 ms
14,196 KB
testcase_07 AC 39 ms
14,208 KB
testcase_08 AC 77 ms
20,972 KB
testcase_09 AC 83 ms
21,408 KB
testcase_10 AC 41 ms
15,060 KB
testcase_11 AC 63 ms
17,012 KB
testcase_12 AC 48 ms
14,640 KB
testcase_13 AC 45 ms
14,756 KB
testcase_14 AC 95 ms
20,412 KB
testcase_15 AC 18 ms
8,756 KB
testcase_16 AC 20 ms
9,296 KB
testcase_17 AC 17 ms
8,500 KB
testcase_18 AC 19 ms
9,600 KB
testcase_19 AC 23 ms
9,556 KB
testcase_20 AC 25 ms
10,008 KB
testcase_21 AC 23 ms
9,956 KB
testcase_22 AC 35 ms
12,968 KB
testcase_23 AC 50 ms
15,152 KB
testcase_24 AC 78 ms
16,560 KB
testcase_25 AC 85 ms
21,536 KB
testcase_26 AC 108 ms
21,656 KB
testcase_27 AC 49 ms
18,916 KB
testcase_28 AC 61 ms
21,140 KB
testcase_29 AC 110 ms
21,692 KB
testcase_30 AC 112 ms
21,328 KB
testcase_31 AC 83 ms
21,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = sorted(list(map(int,input().split())))
if len(set(A))!=n:
    print('NO')
else:
    dis = A[1]-A[0]
    flg = True
    for i in range(1, n):
        if A[i] - A[i-1] != dis:
            flg = False
            break
    print('YES' if flg else 'NO')
0