結果

問題 No.406 鴨等間隔の法則
ユーザー JunOnuma
提出日時 2017-06-08 15:37:48
言語 Python2
(2.7.18)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 202 bytes
コンパイル時間 509 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 14,992 KB
最終ジャッジ日時 2024-07-07 12:04:57
合計ジャッジ時間 3,007 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(raw_input())
l = map(int, raw_input().split())
l.sort()
d = l[1] - l[0]
p = 2
while p < n:
    if d == 0 or l[p] - l[p-1] != d:
        print 'NO'
        break
    p += 1
else:
    print 'YES'
0