結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,752 KB
testcase_01 AC 30 ms
10,880 KB
testcase_02 AC 25 ms
10,624 KB
testcase_03 AC 28 ms
10,752 KB
testcase_04 AC 27 ms
10,752 KB
testcase_05 AC 28 ms
10,752 KB
testcase_06 AC 28 ms
10,880 KB
testcase_07 WA -
testcase_08 AC 26 ms
10,624 KB
testcase_09 AC 26 ms
10,624 KB
testcase_10 AC 302 ms
34,156 KB
testcase_11 AC 282 ms
32,720 KB
testcase_12 AC 79 ms
13,524 KB
testcase_13 AC 85 ms
13,680 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 126 ms
20,408 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 153 ms
19,544 KB
testcase_22 WA -
testcase_23 AC 299 ms
32,600 KB
testcase_24 AC 311 ms
34,096 KB
testcase_25 AC 281 ms
32,728 KB
testcase_26 WA -
testcase_27 AC 88 ms
14,044 KB
testcase_28 AC 90 ms
14,048 KB
testcase_29 AC 93 ms
13,928 KB
testcase_30 AC 98 ms
14,048 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 175 ms
32,724 KB
testcase_34 AC 176 ms
32,600 KB
testcase_35 AC 111 ms
15,772 KB
testcase_36 AC 160 ms
25,756 KB
testcase_37 AC 182 ms
32,728 KB
testcase_38 AC 192 ms
32,724 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 244 ms
27,924 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)

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