結果

問題 No.1884 Sequence
ユーザー brthyyjpbrthyyjp
提出日時 2022-03-27 09:33:59
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 393 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 81,948 KB
実行使用メモリ 118,492 KB
最終ジャッジ日時 2024-04-23 22:26:03
合計ジャッジ時間 6,534 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
53,484 KB
testcase_01 AC 39 ms
52,920 KB
testcase_02 AC 40 ms
52,620 KB
testcase_03 AC 39 ms
52,652 KB
testcase_04 AC 39 ms
52,460 KB
testcase_05 AC 37 ms
53,744 KB
testcase_06 AC 40 ms
53,140 KB
testcase_07 AC 38 ms
53,360 KB
testcase_08 AC 40 ms
53,020 KB
testcase_09 WA -
testcase_10 AC 198 ms
118,424 KB
testcase_11 AC 194 ms
118,492 KB
testcase_12 AC 69 ms
89,216 KB
testcase_13 AC 71 ms
93,920 KB
testcase_14 AC 77 ms
91,780 KB
testcase_15 AC 136 ms
108,160 KB
testcase_16 AC 160 ms
118,480 KB
testcase_17 AC 97 ms
109,892 KB
testcase_18 AC 107 ms
108,748 KB
testcase_19 AC 99 ms
109,600 KB
testcase_20 AC 119 ms
107,288 KB
testcase_21 AC 113 ms
108,312 KB
testcase_22 AC 123 ms
107,628 KB
testcase_23 AC 162 ms
118,116 KB
testcase_24 AC 159 ms
118,248 KB
testcase_25 AC 161 ms
117,576 KB
testcase_26 AC 165 ms
118,424 KB
testcase_27 AC 76 ms
98,184 KB
testcase_28 AC 76 ms
96,652 KB
testcase_29 AC 75 ms
98,064 KB
testcase_30 AC 74 ms
97,448 KB
testcase_31 AC 118 ms
106,972 KB
testcase_32 WA -
testcase_33 AC 119 ms
116,388 KB
testcase_34 AC 118 ms
116,388 KB
testcase_35 AC 90 ms
101,168 KB
testcase_36 AC 122 ms
106,988 KB
testcase_37 AC 123 ms
116,776 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 151 ms
110,592 KB
testcase_42 AC 150 ms
109,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
A.sort()
z = 0
B = []
for a in A:
    if a == 0:
        z += 1
    else:
        B.append(a)

import math
d = 0

B.sort()
for i in range(len(B)-1):
    d = math.gcd(d, B[i+1]-B[i])

if d == 0:
    print('Yes')
    exit()

cnt = 0
for i in range(len(B)-1):
    cnt += (B[i+1]-B[i])//d-1

if cnt <= z:
    print('Yes')
else:
    print('No')
0