結果

問題 No.406 鴨等間隔の法則
ユーザー gorugo30
提出日時 2021-02-23 00:04:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 1,054 ms
コンパイル使用メモリ 82,500 KB
実行使用メモリ 85,024 KB
最終ジャッジ日時 2024-09-21 19:25:07
合計ジャッジ時間 5,073 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
ans = True
S = list(map(int, input().split()))
S.sort()
d = S[1] - S[0]
for i in range(1, N - 1):
    if d != S[i + 1] - S[i]:
        ans = False
        break
if ans and d != 0:
    print("YES")
else:
    print("NO")
0