結果

問題 No.1884 Sequence
ユーザー tnodinotnodino
提出日時 2022-03-28 06:44:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 362 bytes
コンパイル時間 79 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 34,268 KB
最終ジャッジ日時 2024-04-24 14:35:40
合計ジャッジ時間 11,358 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,880 KB
testcase_01 AC 31 ms
10,752 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 31 ms
10,752 KB
testcase_04 AC 37 ms
10,752 KB
testcase_05 AC 31 ms
10,880 KB
testcase_06 AC 31 ms
10,752 KB
testcase_07 AC 30 ms
10,880 KB
testcase_08 AC 31 ms
10,880 KB
testcase_09 WA -
testcase_10 AC 437 ms
34,268 KB
testcase_11 AC 448 ms
32,840 KB
testcase_12 AC 79 ms
13,540 KB
testcase_13 AC 85 ms
13,796 KB
testcase_14 AC 82 ms
14,344 KB
testcase_15 AC 280 ms
23,244 KB
testcase_16 AC 458 ms
34,264 KB
testcase_17 AC 161 ms
20,536 KB
testcase_18 AC 227 ms
24,516 KB
testcase_19 AC 190 ms
21,600 KB
testcase_20 AC 224 ms
20,944 KB
testcase_21 AC 172 ms
19,532 KB
testcase_22 AC 252 ms
22,196 KB
testcase_23 AC 472 ms
32,844 KB
testcase_24 AC 473 ms
34,260 KB
testcase_25 AC 442 ms
32,844 KB
testcase_26 AC 463 ms
34,248 KB
testcase_27 AC 91 ms
14,164 KB
testcase_28 AC 92 ms
14,036 KB
testcase_29 AC 91 ms
14,288 KB
testcase_30 AC 92 ms
14,284 KB
testcase_31 AC 237 ms
21,112 KB
testcase_32 WA -
testcase_33 AC 210 ms
32,844 KB
testcase_34 AC 213 ms
32,844 KB
testcase_35 AC 104 ms
16,016 KB
testcase_36 AC 177 ms
26,636 KB
testcase_37 AC 276 ms
32,840 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 371 ms
28,776 KB
testcase_42 AC 377 ms
28,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
N = int(input())
A = list(map(int,input().split()))
B = []
for i in range(N):
    if A[i] != 0:
        B.append(A[i])
B.sort()
M = len(B)
Z = N - M
G = 0
for i in range(M-1):
    G = gcd(G, B[i+1] - B[i])
cnt = 0
if G > 0:
    for i in range(M-1):
        cnt += (B[i+1] - B[i]) // G - 1
if cnt <= Z:
    print('Yes')
else:
    print('No')
0