結果

問題 No.1884 Sequence
ユーザー yvay5cqeyvay5cqe
提出日時 2022-03-28 00:50:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 677 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 34,252 KB
最終ジャッジ日時 2024-04-24 10:22:33
合計ジャッジ時間 11,277 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,752 KB
testcase_01 AC 31 ms
10,752 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 29 ms
10,752 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 30 ms
10,752 KB
testcase_06 AC 30 ms
10,752 KB
testcase_07 AC 30 ms
10,752 KB
testcase_08 AC 31 ms
10,752 KB
testcase_09 AC 30 ms
10,752 KB
testcase_10 AC 360 ms
34,128 KB
testcase_11 AC 358 ms
34,132 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 77 ms
14,224 KB
testcase_15 AC 260 ms
23,228 KB
testcase_16 AC 542 ms
34,248 KB
testcase_17 AC 177 ms
20,528 KB
testcase_18 AC 207 ms
24,576 KB
testcase_19 AC 215 ms
21,332 KB
testcase_20 AC 215 ms
20,928 KB
testcase_21 AC 145 ms
19,264 KB
testcase_22 AC 218 ms
22,048 KB
testcase_23 AC 541 ms
32,572 KB
testcase_24 AC 535 ms
34,252 KB
testcase_25 AC 362 ms
32,568 KB
testcase_26 AC 357 ms
34,108 KB
testcase_27 AC 83 ms
14,756 KB
testcase_28 AC 83 ms
14,756 KB
testcase_29 AC 81 ms
14,628 KB
testcase_30 AC 82 ms
14,756 KB
testcase_31 AC 186 ms
21,092 KB
testcase_32 AC 340 ms
32,912 KB
testcase_33 AC 288 ms
32,564 KB
testcase_34 AC 293 ms
32,692 KB
testcase_35 AC 98 ms
15,876 KB
testcase_36 AC 219 ms
26,248 KB
testcase_37 AC 232 ms
32,696 KB
testcase_38 AC 282 ms
33,888 KB
testcase_39 AC 127 ms
18,584 KB
testcase_40 AC 126 ms
19,488 KB
testcase_41 AC 308 ms
28,808 KB
testcase_42 AC 429 ms
28,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
zero_count = A.count(0)
AA = []
for x in A:
    if x != 0:
        AA.append(x)

AA.sort()
# print(zero_count, AA)
poss = 10**15
pre = -10**15
for x in AA:
    poss = min(poss, x - pre)
    pre = x

# print(poss)
ans = True
for i in range(len(AA) - 1):
    dif = AA[i + 1] - AA[i]
    if poss == 0:
        if dif != 0:
            ans = 0
            break
        else:
            continue

    if dif % poss != 0:
        # print(dif, poss)
        ans = 0
        break
    zero_count -= dif // poss - 1
    if zero_count < 0:
        # print(-1, dif, poss)
        ans = 0
        break

print("Yes" if ans else "No")
0