結果

問題 No.406 鴨等間隔の法則
ユーザー rin204
提出日時 2020-06-09 20:26:56
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 219 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 21,428 KB
最終ジャッジ日時 2025-01-02 17:08:46
合計ジャッジ時間 3,396 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
x = list(map(int, input().split()))
x.sort()
w = x[1] - x[0]
before = x[1]
for num in x[2:]:
    if w != num - before or w == 0:
        print("NO")
        break
    before = num
else:
    print("YES")
0