結果

問題 No.1884 Sequence
ユーザー k_o_pasturek_o_pasture
提出日時 2022-03-25 22:17:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 494 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 34,360 KB
最終ジャッジ日時 2024-04-22 06:57:51
合計ジャッジ時間 10,377 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,880 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 31 ms
10,880 KB
testcase_04 AC 31 ms
10,880 KB
testcase_05 AC 31 ms
10,880 KB
testcase_06 AC 31 ms
10,880 KB
testcase_07 AC 30 ms
10,880 KB
testcase_08 AC 33 ms
10,880 KB
testcase_09 AC 31 ms
10,880 KB
testcase_10 AC 406 ms
34,284 KB
testcase_11 AC 409 ms
34,280 KB
testcase_12 AC 88 ms
13,552 KB
testcase_13 AC 96 ms
13,800 KB
testcase_14 AC 92 ms
14,388 KB
testcase_15 AC 278 ms
23,380 KB
testcase_16 AC 429 ms
34,276 KB
testcase_17 AC 155 ms
20,540 KB
testcase_18 AC 216 ms
24,656 KB
testcase_19 AC 173 ms
21,488 KB
testcase_20 AC 233 ms
20,952 KB
testcase_21 AC 183 ms
19,412 KB
testcase_22 AC 251 ms
22,072 KB
testcase_23 AC 425 ms
32,704 KB
testcase_24 AC 423 ms
34,276 KB
testcase_25 AC 408 ms
32,720 KB
testcase_26 AC 433 ms
34,252 KB
testcase_27 AC 103 ms
14,296 KB
testcase_28 AC 107 ms
14,292 KB
testcase_29 AC 105 ms
14,428 KB
testcase_30 AC 103 ms
14,424 KB
testcase_31 AC 233 ms
21,116 KB
testcase_32 WA -
testcase_33 AC 195 ms
34,304 KB
testcase_34 AC 194 ms
34,332 KB
testcase_35 AC 120 ms
16,028 KB
testcase_36 AC 180 ms
26,520 KB
testcase_37 AC 238 ms
34,360 KB
testcase_38 AC 233 ms
33,912 KB
testcase_39 AC 147 ms
18,616 KB
testcase_40 AC 157 ms
19,512 KB
testcase_41 AC 353 ms
28,964 KB
testcase_42 AC 367 ms
28,832 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 and s >= 0:
	print('Yes')
else:
	print('No')
0