結果

問題 No.1884 Sequence
ユーザー ikoma
提出日時 2022-03-25 23:05:39
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 495 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 82,320 KB
実行使用メモリ 179,548 KB
最終ジャッジ日時 2024-10-14 07:12:11
合計ジャッジ時間 6,064 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34 WA * 2 RE * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

def solve():
    N=int(input())
    A=list(map(int,input().split()))
    A.sort()
    cnt0=0
    d_lst = []
    for i in range(N-1):
        if A[i]==0:
            cnt0+=1
            continue
        d = A[i+1]-A[i]
        d_lst.append(d)
    d_min = min(d_lst)
    if d_min==0:
        return len(set(A)-set([0]))==1
    for d in d_lst:
        if d%d_min!=0:return False
        cnt0 -= d//d_min-1
    return cnt0>=0

print("Yes" if solve() else "No")
0