結果

問題 No.1884 Sequence
ユーザー k_o_pasturek_o_pasture
提出日時 2022-03-25 21:54:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 483 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 34,152 KB
最終ジャッジ日時 2024-04-22 06:35:28
合計ジャッジ時間 8,963 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,880 KB
testcase_01 AC 31 ms
10,880 KB
testcase_02 AC 27 ms
10,752 KB
testcase_03 AC 27 ms
10,752 KB
testcase_04 AC 26 ms
10,624 KB
testcase_05 AC 27 ms
10,624 KB
testcase_06 AC 26 ms
10,752 KB
testcase_07 AC 28 ms
10,752 KB
testcase_08 AC 28 ms
10,752 KB
testcase_09 WA -
testcase_10 AC 337 ms
34,004 KB
testcase_11 AC 349 ms
34,004 KB
testcase_12 AC 79 ms
13,548 KB
testcase_13 AC 87 ms
13,808 KB
testcase_14 AC 86 ms
14,132 KB
testcase_15 AC 234 ms
23,252 KB
testcase_16 AC 345 ms
34,148 KB
testcase_17 AC 145 ms
20,436 KB
testcase_18 AC 188 ms
24,532 KB
testcase_19 AC 162 ms
21,488 KB
testcase_20 AC 203 ms
20,828 KB
testcase_21 AC 164 ms
19,292 KB
testcase_22 AC 220 ms
21,952 KB
testcase_23 AC 365 ms
34,004 KB
testcase_24 AC 361 ms
34,152 KB
testcase_25 AC 365 ms
33,812 KB
testcase_26 AC 349 ms
32,728 KB
testcase_27 AC 99 ms
14,656 KB
testcase_28 AC 95 ms
14,780 KB
testcase_29 AC 90 ms
14,776 KB
testcase_30 AC 94 ms
14,780 KB
testcase_31 AC 202 ms
20,996 KB
testcase_32 WA -
testcase_33 AC 170 ms
32,600 KB
testcase_34 AC 176 ms
32,728 KB
testcase_35 AC 109 ms
15,772 KB
testcase_36 AC 161 ms
26,384 KB
testcase_37 AC 214 ms
32,728 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 298 ms
28,700 KB
testcase_42 AC 296 ms
28,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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',D)

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

G = gcd(*D) # 差の最大公約数
# print('G',G)
s = 0
for d in D:
	s += (d // G) - 1
# print('s',s)
if c >= s:
	print('Yes')
else:
	print('No')
0