結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
51,968 KB
testcase_01 AC 35 ms
51,712 KB
testcase_02 AC 38 ms
52,096 KB
testcase_03 AC 38 ms
51,712 KB
testcase_04 AC 35 ms
51,840 KB
testcase_05 AC 35 ms
52,480 KB
testcase_06 AC 36 ms
51,968 KB
testcase_07 AC 35 ms
51,712 KB
testcase_08 AC 36 ms
52,096 KB
testcase_09 AC 35 ms
52,096 KB
testcase_10 AC 145 ms
117,840 KB
testcase_11 AC 136 ms
118,536 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 66 ms
91,828 KB
testcase_15 AC 111 ms
108,472 KB
testcase_16 AC 141 ms
118,188 KB
testcase_17 AC 85 ms
109,656 KB
testcase_18 AC 91 ms
108,572 KB
testcase_19 AC 85 ms
109,420 KB
testcase_20 AC 101 ms
107,376 KB
testcase_21 AC 89 ms
106,252 KB
testcase_22 AC 106 ms
107,804 KB
testcase_23 AC 139 ms
118,304 KB
testcase_24 AC 138 ms
118,032 KB
testcase_25 AC 138 ms
117,668 KB
testcase_26 AC 140 ms
118,588 KB
testcase_27 AC 65 ms
96,960 KB
testcase_28 AC 67 ms
98,108 KB
testcase_29 AC 70 ms
97,712 KB
testcase_30 AC 71 ms
97,536 KB
testcase_31 AC 102 ms
106,752 KB
testcase_32 AC 165 ms
148,456 KB
testcase_33 AC 102 ms
116,432 KB
testcase_34 AC 106 ms
116,440 KB
testcase_35 AC 75 ms
101,916 KB
testcase_36 AC 103 ms
106,512 KB
testcase_37 AC 101 ms
116,416 KB
testcase_38 AC 101 ms
114,484 KB
testcase_39 AC 82 ms
105,092 KB
testcase_40 AC 87 ms
107,364 KB
testcase_41 AC 132 ms
110,888 KB
testcase_42 AC 135 ms
110,376 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