結果

問題 No.1884 Sequence
ユーザー brthyyjpbrthyyjp
提出日時 2022-03-27 09:22:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 602 bytes
コンパイル時間 363 ms
コンパイル使用メモリ 82,536 KB
実行使用メモリ 148,620 KB
最終ジャッジ日時 2024-04-23 22:12:35
合計ジャッジ時間 7,406 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,412 KB
testcase_01 AC 39 ms
52,664 KB
testcase_02 AC 39 ms
53,348 KB
testcase_03 AC 38 ms
52,536 KB
testcase_04 AC 37 ms
52,740 KB
testcase_05 AC 38 ms
53,020 KB
testcase_06 AC 39 ms
52,888 KB
testcase_07 AC 37 ms
52,512 KB
testcase_08 AC 38 ms
52,688 KB
testcase_09 AC 38 ms
52,768 KB
testcase_10 AC 153 ms
118,180 KB
testcase_11 AC 152 ms
118,276 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 78 ms
93,716 KB
testcase_15 AC 128 ms
108,240 KB
testcase_16 AC 159 ms
118,188 KB
testcase_17 AC 98 ms
109,468 KB
testcase_18 AC 105 ms
108,964 KB
testcase_19 AC 98 ms
110,080 KB
testcase_20 AC 118 ms
107,332 KB
testcase_21 AC 102 ms
106,880 KB
testcase_22 AC 122 ms
107,740 KB
testcase_23 AC 159 ms
118,548 KB
testcase_24 AC 158 ms
118,360 KB
testcase_25 AC 156 ms
117,288 KB
testcase_26 AC 159 ms
118,592 KB
testcase_27 AC 76 ms
97,960 KB
testcase_28 AC 75 ms
98,192 KB
testcase_29 AC 78 ms
97,900 KB
testcase_30 AC 79 ms
98,576 KB
testcase_31 AC 117 ms
106,356 KB
testcase_32 AC 182 ms
148,620 KB
testcase_33 AC 116 ms
116,328 KB
testcase_34 AC 115 ms
116,728 KB
testcase_35 AC 88 ms
102,292 KB
testcase_36 AC 119 ms
107,012 KB
testcase_37 AC 117 ms
116,456 KB
testcase_38 AC 117 ms
114,888 KB
testcase_39 AC 96 ms
105,672 KB
testcase_40 AC 103 ms
108,544 KB
testcase_41 AC 152 ms
110,500 KB
testcase_42 AC 150 ms
109,764 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)
d = 10**18
for i in range(n-1):
    if A[i] == 0 or A[i+1] == 0:
        continue
    d = min(d, A[i+1]-A[i])

if d == 10**18:
    print('Yes')
    exit()

if d == 0:
    if len(set(B)) == 1:
        print('Yes')
    else:
        print('No')
    exit()

B.sort(reverse=True)
cur = B[0]+d
cnt = 0
for b in B:
    if (cur-b)%d != 0:
        print('No')
        exit()
    cnt += (cur-b)//d-1
    cur = b
if cnt <= z:
    print('Yes')
else:
    print('No')
0