結果

問題 No.1884 Sequence
ユーザー brthyyjpbrthyyjp
提出日時 2022-03-27 09:26:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 606 bytes
コンパイル時間 353 ms
コンパイル使用メモリ 82,252 KB
実行使用メモリ 147,956 KB
最終ジャッジ日時 2024-04-23 22:17:59
合計ジャッジ時間 7,875 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,212 KB
testcase_01 AC 39 ms
53,776 KB
testcase_02 AC 39 ms
52,532 KB
testcase_03 AC 42 ms
52,952 KB
testcase_04 AC 41 ms
52,084 KB
testcase_05 AC 42 ms
52,692 KB
testcase_06 AC 40 ms
52,928 KB
testcase_07 AC 39 ms
52,400 KB
testcase_08 AC 44 ms
53,528 KB
testcase_09 AC 41 ms
52,688 KB
testcase_10 AC 158 ms
117,764 KB
testcase_11 AC 157 ms
118,148 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 77 ms
91,444 KB
testcase_15 AC 131 ms
108,172 KB
testcase_16 AC 163 ms
117,688 KB
testcase_17 AC 100 ms
110,012 KB
testcase_18 AC 110 ms
108,576 KB
testcase_19 AC 100 ms
109,624 KB
testcase_20 AC 123 ms
106,840 KB
testcase_21 AC 108 ms
106,032 KB
testcase_22 AC 122 ms
107,724 KB
testcase_23 AC 163 ms
118,348 KB
testcase_24 AC 165 ms
117,680 KB
testcase_25 AC 166 ms
116,996 KB
testcase_26 AC 168 ms
118,732 KB
testcase_27 AC 80 ms
97,320 KB
testcase_28 AC 77 ms
97,616 KB
testcase_29 AC 76 ms
97,512 KB
testcase_30 AC 78 ms
96,592 KB
testcase_31 AC 119 ms
107,040 KB
testcase_32 AC 197 ms
147,956 KB
testcase_33 AC 124 ms
115,944 KB
testcase_34 AC 122 ms
116,308 KB
testcase_35 AC 90 ms
101,992 KB
testcase_36 AC 121 ms
106,476 KB
testcase_37 AC 123 ms
116,088 KB
testcase_38 AC 121 ms
114,596 KB
testcase_39 AC 96 ms
104,936 KB
testcase_40 AC 98 ms
107,052 KB
testcase_41 AC 153 ms
110,268 KB
testcase_42 AC 158 ms
109,884 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)
if z == n:
    print('Yes')
    exit()
d = 10**18

B.sort()
for i in range(len(B)-1):
    d = min(d, B[i+1]-B[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