結果

問題 No.1884 Sequence
ユーザー ytftytft
提出日時 2022-03-28 16:02:12
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 403 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 109,824 KB
最終ジャッジ日時 2024-04-24 22:25:04
合計ジャッジ時間 7,840 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
52,096 KB
testcase_01 AC 42 ms
51,840 KB
testcase_02 AC 43 ms
52,096 KB
testcase_03 AC 43 ms
52,480 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 AC 41 ms
51,840 KB
testcase_07 AC 41 ms
51,840 KB
testcase_08 AC 42 ms
51,968 KB
testcase_09 RE -
testcase_10 AC 161 ms
106,436 KB
testcase_11 AC 160 ms
106,296 KB
testcase_12 AC 77 ms
89,088 KB
testcase_13 AC 79 ms
93,184 KB
testcase_14 AC 87 ms
93,056 KB
testcase_15 AC 139 ms
109,824 KB
testcase_16 AC 164 ms
105,688 KB
testcase_17 AC 108 ms
107,520 KB
testcase_18 AC 117 ms
109,824 KB
testcase_19 AC 110 ms
105,472 KB
testcase_20 AC 133 ms
108,544 KB
testcase_21 AC 123 ms
107,392 KB
testcase_22 AC 135 ms
108,928 KB
testcase_23 AC 163 ms
105,804 KB
testcase_24 AC 165 ms
105,944 KB
testcase_25 AC 164 ms
104,900 KB
testcase_26 AC 166 ms
106,108 KB
testcase_27 AC 86 ms
97,280 KB
testcase_28 RE -
testcase_29 AC 85 ms
97,536 KB
testcase_30 AC 85 ms
97,536 KB
testcase_31 RE -
testcase_32 RE -
testcase_33 AC 122 ms
104,084 KB
testcase_34 AC 123 ms
104,076 KB
testcase_35 AC 97 ms
100,992 KB
testcase_36 AC 129 ms
101,760 KB
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 AC 159 ms
101,756 KB
testcase_42 AC 158 ms
101,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,bisect
input=lambda:sys.stdin.readline().rstrip()
def gcd(a,b):
	m,M=min(a,b),max(a,b)
	return M if m==0 else gcd(m,M%m)
N=int(input())
A=sorted(list(map(int,input().split())))
ind=bisect.bisect_right(A,0)
d,flg=0,0
for i in range(ind,N-1):
	d=gcd(d,A[i+1]-A[i])
	flg|=A[i]==A[i-1]
if flg:
	print(['Yes','No'][d])
elif ind==N:
	print('Yes')
else:
	print(['Yes','No'][(A[-1]-A[ind])//d+1-N>0])
0