結果

問題 No.1884 Sequence
ユーザー Goltermann大和
提出日時 2022-03-25 22:48:45
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 573 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 43,100 KB
最終ジャッジ日時 2024-10-14 06:48:31
合計ジャッジ時間 9,302 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23 WA * 2 RE * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
n = int(input())
a = list(map(int,input().split()))
a_plus = []
zero_count = 0
for _ in a:
    if _ != 0:
        a_plus.append(_)
    else:
        zero_count += 1
a_plus.sort()
a_dfr = [a_plus[i+1]-a_plus[i] for i in range(len(a_plus)-1)]
min_dfr = min(a_dfr)
if min_dfr == 0 and (1 in set(a_plus)) and len(set(a_plus))==1:
    print("Yes")
    sys.exit()
mlt_count = 0
for j in a_dfr:
    if j%min_dfr==0:
        mlt_count += (j//min_dfr)-1
    else:
        print("No")
        sys.exit()

if mlt_count <= zero_count:
    print("Yes")
else:
    print("No")
0