結果

問題 No.1884 Sequence
ユーザー rlangevinrlangevin
提出日時 2023-01-01 14:46:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 584 bytes
コンパイル時間 347 ms
コンパイル使用メモリ 87,064 KB
実行使用メモリ 164,952 KB
最終ジャッジ日時 2023-08-17 23:03:43
合計ジャッジ時間 8,733 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,320 KB
testcase_01 AC 72 ms
71,340 KB
testcase_02 AC 72 ms
71,164 KB
testcase_03 AC 73 ms
71,248 KB
testcase_04 AC 73 ms
71,496 KB
testcase_05 AC 73 ms
71,052 KB
testcase_06 AC 74 ms
71,200 KB
testcase_07 AC 73 ms
71,336 KB
testcase_08 AC 73 ms
71,272 KB
testcase_09 AC 73 ms
71,104 KB
testcase_10 AC 219 ms
164,784 KB
testcase_11 AC 215 ms
164,852 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 104 ms
98,316 KB
testcase_15 AC 172 ms
126,736 KB
testcase_16 AC 214 ms
164,632 KB
testcase_17 AC 129 ms
107,284 KB
testcase_18 AC 155 ms
129,828 KB
testcase_19 AC 134 ms
104,520 KB
testcase_20 AC 154 ms
107,680 KB
testcase_21 AC 134 ms
108,952 KB
testcase_22 AC 166 ms
123,432 KB
testcase_23 AC 217 ms
164,724 KB
testcase_24 AC 215 ms
164,952 KB
testcase_25 AC 217 ms
164,244 KB
testcase_26 AC 218 ms
164,748 KB
testcase_27 AC 105 ms
104,128 KB
testcase_28 AC 106 ms
104,300 KB
testcase_29 AC 114 ms
104,420 KB
testcase_30 AC 112 ms
104,648 KB
testcase_31 AC 151 ms
102,132 KB
testcase_32 AC 215 ms
163,384 KB
testcase_33 AC 146 ms
118,104 KB
testcase_34 AC 142 ms
118,080 KB
testcase_35 AC 109 ms
104,984 KB
testcase_36 AC 136 ms
107,508 KB
testcase_37 AC 152 ms
131,876 KB
testcase_38 AC 152 ms
130,820 KB
testcase_39 AC 120 ms
108,364 KB
testcase_40 AC 119 ms
106,756 KB
testcase_41 AC 196 ms
146,992 KB
testcase_42 AC 196 ms
146,364 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])
minv = min(D)
if minv == 0:
    print("No")
    exit()
    
cnt = 0
for d in D:
    cnt += d - 1
if cnt <= zero:
    print("Yes")
    exit()


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