結果

問題 No.406 鴨等間隔の法則
ユーザー brthyyjp
提出日時 2021-01-11 21:24:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 686 ms
コンパイル使用メモリ 82,536 KB
実行使用メモリ 99,072 KB
最終ジャッジ日時 2024-11-21 09:24:42
合計ジャッジ時間 4,450 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
X = list(map(int, input().split()))

if len(X) != len(set(X)):
    print('NO')
    exit()

X.sort()
d = X[1]-X[0]
for i in range(n-1):
    if X[i]+d != X[i+1]:
        print('NO')
        exit()
else:
    print('YES')
0