結果

問題 No.1884 Sequence
ユーザー n_nan_na
提出日時 2022-03-25 23:51:30
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 467 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 108,596 KB
最終ジャッジ日時 2024-04-22 08:55:30
合計ジャッジ時間 6,163 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,456 KB
testcase_01 AC 38 ms
51,840 KB
testcase_02 AC 38 ms
51,840 KB
testcase_03 AC 38 ms
51,456 KB
testcase_04 AC 39 ms
52,096 KB
testcase_05 AC 38 ms
51,584 KB
testcase_06 AC 38 ms
52,096 KB
testcase_07 AC 39 ms
51,968 KB
testcase_08 AC 38 ms
52,480 KB
testcase_09 RE -
testcase_10 AC 152 ms
103,820 KB
testcase_11 AC 140 ms
104,600 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 76 ms
89,856 KB
testcase_15 AC 118 ms
108,416 KB
testcase_16 AC 148 ms
104,756 KB
testcase_17 WA -
testcase_18 AC 94 ms
108,596 KB
testcase_19 AC 83 ms
100,992 KB
testcase_20 AC 108 ms
105,288 KB
testcase_21 AC 99 ms
102,784 KB
testcase_22 AC 115 ms
107,136 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 148 ms
103,444 KB
testcase_26 AC 138 ms
104,640 KB
testcase_27 AC 104 ms
97,280 KB
testcase_28 AC 77 ms
97,280 KB
testcase_29 AC 76 ms
96,512 KB
testcase_30 AC 75 ms
96,896 KB
testcase_31 RE -
testcase_32 RE -
testcase_33 AC 106 ms
102,248 KB
testcase_34 AC 107 ms
102,564 KB
testcase_35 AC 88 ms
99,840 KB
testcase_36 AC 113 ms
101,632 KB
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 AC 142 ms
100,352 KB
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
num = A.count(0)

A.sort()
d = 10**16

for i in range(N-1):
    if A[i+1] == 0:
        continue
    tmp = A[i+1] - A[i]
    d = min(tmp,d)
A.reverse()

ans = "Yes"
for i in range(N-1):
    if A[i+1] == 0:
        continue
    if A[i+1] - A[i] == d:
        continue
    if (A[i] - A[i+1])%d != 0:
        ans = "No"
        break
    else:
        num -= (A[i] - A[i+1])//d - 1

print(ans if num >= 0 else "No")

0