結果

問題 No.1884 Sequence
コンテスト
ユーザー k_o_pasture
提出日時 2022-03-25 21:47:16
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 428 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 420 ms
コンパイル使用メモリ 20,828 KB
実行使用メモリ 36,420 KB
最終ジャッジ日時 2026-05-01 15:41:24
合計ジャッジ時間 11,562 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from math import *

N = int(input())
A = sorted(list(map(int, input().split())))

c = 0 # 0 の数
B = []
for a in A:
	if a == 0:
		c += 1
	else:
		B.append(a)
# print('c',c)
# print('B',B)

D = [] # 差

for i in range(1,len(B)):
	D.append(B[i]-B[i-1])
# print(D)

if len(D) == len([d for d in D if d == 0]):
	print('Yes')
	exit()

G = gcd(*D) # 差の最大公約数
M = max(D) // G
if c >= M:
	print('Yes')
else:
	print('No')
0