結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,108 KB
testcase_01 AC 69 ms
71,396 KB
testcase_02 AC 70 ms
71,100 KB
testcase_03 RE -
testcase_04 AC 71 ms
71,316 KB
testcase_05 AC 71 ms
71,392 KB
testcase_06 AC 70 ms
71,180 KB
testcase_07 AC 71 ms
71,100 KB
testcase_08 AC 71 ms
71,104 KB
testcase_09 AC 70 ms
71,280 KB
testcase_10 AC 219 ms
164,648 KB
testcase_11 AC 210 ms
164,688 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 102 ms
98,312 KB
testcase_15 AC 170 ms
126,696 KB
testcase_16 AC 208 ms
164,600 KB
testcase_17 AC 127 ms
107,080 KB
testcase_18 AC 152 ms
129,908 KB
testcase_19 AC 131 ms
104,520 KB
testcase_20 AC 149 ms
107,968 KB
testcase_21 AC 129 ms
108,724 KB
testcase_22 AC 162 ms
123,408 KB
testcase_23 AC 210 ms
164,556 KB
testcase_24 AC 210 ms
164,852 KB
testcase_25 AC 211 ms
164,124 KB
testcase_26 AC 213 ms
164,868 KB
testcase_27 RE -
testcase_28 AC 103 ms
104,380 KB
testcase_29 AC 104 ms
104,328 KB
testcase_30 AC 103 ms
104,348 KB
testcase_31 AC 140 ms
102,184 KB
testcase_32 AC 205 ms
163,460 KB
testcase_33 AC 139 ms
117,928 KB
testcase_34 AC 137 ms
117,868 KB
testcase_35 AC 107 ms
105,096 KB
testcase_36 AC 135 ms
107,384 KB
testcase_37 AC 150 ms
131,696 KB
testcase_38 AC 149 ms
130,364 KB
testcase_39 AC 115 ms
108,224 KB
testcase_40 AC 116 ms
106,884 KB
testcase_41 AC 194 ms
146,704 KB
testcase_42 AC 194 ms
146,344 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