結果

問題 No.1884 Sequence
ユーザー rlangevinrlangevin
提出日時 2023-01-01 14:42:10
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 538 bytes
コンパイル時間 1,114 ms
コンパイル使用メモリ 86,996 KB
実行使用メモリ 166,216 KB
最終ジャッジ日時 2023-08-17 23:03:24
合計ジャッジ時間 12,986 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,232 KB
testcase_01 AC 81 ms
71,272 KB
testcase_02 AC 80 ms
71,084 KB
testcase_03 AC 77 ms
71,356 KB
testcase_04 AC 79 ms
71,236 KB
testcase_05 AC 77 ms
71,188 KB
testcase_06 AC 77 ms
71,160 KB
testcase_07 AC 77 ms
71,416 KB
testcase_08 AC 78 ms
71,288 KB
testcase_09 RE -
testcase_10 AC 233 ms
164,584 KB
testcase_11 AC 231 ms
164,808 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 112 ms
98,264 KB
testcase_15 AC 184 ms
126,652 KB
testcase_16 AC 228 ms
164,764 KB
testcase_17 AC 138 ms
106,996 KB
testcase_18 AC 169 ms
129,924 KB
testcase_19 AC 144 ms
104,644 KB
testcase_20 AC 161 ms
107,692 KB
testcase_21 AC 140 ms
108,848 KB
testcase_22 AC 174 ms
123,660 KB
testcase_23 AC 225 ms
164,616 KB
testcase_24 AC 229 ms
165,080 KB
testcase_25 AC 229 ms
164,044 KB
testcase_26 AC 233 ms
164,908 KB
testcase_27 AC 113 ms
104,120 KB
testcase_28 AC 115 ms
104,324 KB
testcase_29 AC 116 ms
104,652 KB
testcase_30 AC 116 ms
104,332 KB
testcase_31 RE -
testcase_32 RE -
testcase_33 AC 150 ms
117,868 KB
testcase_34 AC 150 ms
117,856 KB
testcase_35 AC 116 ms
105,012 KB
testcase_36 AC 146 ms
107,492 KB
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 AC 210 ms
146,728 KB
testcase_42 AC 208 ms
146,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
L = []
zero = 0
for a in A:
    if a == 0:
        zero += 1
    else:
        L.append(a)
        
L.sort()
if len(set(L)) == 1:
    print("Yes")
    exit()
D = []
for i in range(len(L) - 1):
    D.append(L[i + 1] - L[i])

cnt = 0
for d in D:
    cnt += d - 1
if cnt <= zero:
    print("Yes")
    exit()

minv = min(D)
cnt = 0
for d in D:
    if d % minv != 0:
        print("No")
        exit()
    cnt += d // minv - 1
    
if cnt <= zero:
    print("Yes")
else:
    print("No")    
0