結果

問題 No.406 鴨等間隔の法則
ユーザー akitsugu777akitsugu777
提出日時 2018-10-16 13:15:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 239 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 10,728 KB
実行使用メモリ 19,088 KB
最終ジャッジ日時 2023-09-21 18:54:17
合計ジャッジ時間 3,274 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
12,732 KB
testcase_01 AC 15 ms
7,880 KB
testcase_02 AC 15 ms
7,880 KB
testcase_03 AC 15 ms
7,788 KB
testcase_04 AC 89 ms
17,840 KB
testcase_05 AC 41 ms
12,428 KB
testcase_06 AC 46 ms
12,384 KB
testcase_07 AC 42 ms
12,416 KB
testcase_08 AC 88 ms
18,360 KB
testcase_09 AC 94 ms
18,780 KB
testcase_10 AC 45 ms
12,716 KB
testcase_11 AC 76 ms
16,480 KB
testcase_12 AC 54 ms
13,536 KB
testcase_13 AC 51 ms
12,860 KB
testcase_14 AC 83 ms
17,164 KB
testcase_15 AC 18 ms
8,792 KB
testcase_16 AC 21 ms
9,460 KB
testcase_17 AC 18 ms
8,432 KB
testcase_18 AC 20 ms
9,508 KB
testcase_19 AC 21 ms
9,016 KB
testcase_20 AC 24 ms
9,356 KB
testcase_21 AC 25 ms
10,436 KB
testcase_22 AC 32 ms
10,708 KB
testcase_23 AC 55 ms
13,736 KB
testcase_24 AC 70 ms
15,760 KB
testcase_25 AC 96 ms
18,748 KB
testcase_26 AC 92 ms
18,956 KB
testcase_27 AC 67 ms
19,088 KB
testcase_28 AC 72 ms
18,756 KB
testcase_29 AC 94 ms
19,048 KB
testcase_30 AC 92 ms
18,856 KB
testcase_31 AC 92 ms
18,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
l = list(map(int, input().split()))
l = sorted(l)


l2 = []
for i in range(n-1):
    l2.append(l[i+1] - l[i])

if 0 in l2:
    print('NO')

else:
    if len(set(l2)) != 1:
        print('NO')
    else:
        print('YES')
0