結果

問題 No.1884 Sequence
ユーザー square1001square1001
提出日時 2022-03-25 21:24:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 369 bytes
コンパイル時間 258 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 34,272 KB
最終ジャッジ日時 2024-04-22 05:58:39
合計ジャッジ時間 8,562 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
10,880 KB
testcase_01 AC 35 ms
10,752 KB
testcase_02 AC 31 ms
10,880 KB
testcase_03 AC 33 ms
10,752 KB
testcase_04 AC 31 ms
10,880 KB
testcase_05 AC 31 ms
10,880 KB
testcase_06 AC 32 ms
10,752 KB
testcase_07 AC 32 ms
10,880 KB
testcase_08 AC 31 ms
10,880 KB
testcase_09 WA -
testcase_10 AC 320 ms
34,272 KB
testcase_11 AC 319 ms
34,272 KB
testcase_12 AC 73 ms
13,548 KB
testcase_13 AC 77 ms
13,804 KB
testcase_14 AC 75 ms
14,252 KB
testcase_15 AC 212 ms
23,252 KB
testcase_16 AC 334 ms
34,192 KB
testcase_17 AC 124 ms
20,540 KB
testcase_18 AC 158 ms
24,632 KB
testcase_19 AC 135 ms
21,608 KB
testcase_20 AC 181 ms
21,084 KB
testcase_21 AC 143 ms
19,416 KB
testcase_22 AC 196 ms
22,076 KB
testcase_23 AC 341 ms
32,852 KB
testcase_24 AC 339 ms
34,268 KB
testcase_25 AC 338 ms
32,720 KB
testcase_26 AC 332 ms
34,252 KB
testcase_27 AC 84 ms
14,048 KB
testcase_28 AC 83 ms
14,172 KB
testcase_29 AC 82 ms
14,048 KB
testcase_30 AC 82 ms
14,172 KB
testcase_31 AC 174 ms
21,120 KB
testcase_32 WA -
testcase_33 AC 142 ms
32,724 KB
testcase_34 AC 144 ms
32,856 KB
testcase_35 AC 89 ms
15,900 KB
testcase_36 AC 127 ms
26,004 KB
testcase_37 AC 203 ms
32,724 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 269 ms
28,824 KB
testcase_42 AC 264 ms
28,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

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

v = []
for i in A:
	if i != 0:
		v.append(i)

v.sort()
if len(v) == 0:
	print("Yes")
elif v[0] == v[-1]:
	print("Yes")
else:
	g = v[1] - v[0]
	for i in range(1, len(v)):
		g = math.gcd(g, v[i] - v[i - 1])
	if g == 0:
		print("No")
	elif (v[-1] - v[0]) // g <= N - 1:
		print("Yes")
	else:
		print("No")
0