結果

問題 No.1884 Sequence
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-03-25 22:09:52
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 473 bytes
コンパイル時間 266 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 111,304 KB
最終ジャッジ日時 2024-04-22 06:50:21
合計ジャッジ時間 6,151 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,840 KB
testcase_01 AC 39 ms
51,968 KB
testcase_02 AC 38 ms
51,968 KB
testcase_03 RE -
testcase_04 AC 36 ms
51,840 KB
testcase_05 AC 36 ms
52,224 KB
testcase_06 AC 36 ms
51,584 KB
testcase_07 AC 37 ms
51,840 KB
testcase_08 AC 38 ms
52,224 KB
testcase_09 WA -
testcase_10 AC 178 ms
111,124 KB
testcase_11 AC 176 ms
110,604 KB
testcase_12 AC 69 ms
89,856 KB
testcase_13 AC 72 ms
93,696 KB
testcase_14 AC 75 ms
92,288 KB
testcase_15 AC 122 ms
110,208 KB
testcase_16 AC 146 ms
110,752 KB
testcase_17 AC 93 ms
107,264 KB
testcase_18 AC 102 ms
110,080 KB
testcase_19 AC 93 ms
106,112 KB
testcase_20 AC 127 ms
110,720 KB
testcase_21 AC 106 ms
106,112 KB
testcase_22 AC 128 ms
110,848 KB
testcase_23 AC 141 ms
110,616 KB
testcase_24 AC 146 ms
110,748 KB
testcase_25 AC 148 ms
109,836 KB
testcase_26 AC 146 ms
111,304 KB
testcase_27 RE -
testcase_28 AC 86 ms
98,176 KB
testcase_29 AC 80 ms
98,048 KB
testcase_30 AC 82 ms
97,920 KB
testcase_31 AC 112 ms
102,912 KB
testcase_32 WA -
testcase_33 AC 111 ms
107,604 KB
testcase_34 AC 110 ms
107,224 KB
testcase_35 AC 89 ms
100,736 KB
testcase_36 AC 119 ms
102,188 KB
testcase_37 AC 119 ms
109,392 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 145 ms
105,072 KB
testcase_42 AC 145 ms
104,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
n = int(input())
A = sorted(list(map(int,input().split())))
zero = 0
for i in range(n):
    if A[i] != 0:
        nA = A[i:]
        zero = i
        break

if len(nA) == 1:
    print("Yes")
    exit()

g = nA[1]-nA[0]
for a,na in zip(nA,nA[1:]):
    dif = na-a
    g = gcd(dif,g)

if g == 0:
    print("Yes" if len(set(nA)) == 1 else "No")
    exit()

for a,na in zip(nA,nA[1:]):
    dif = na-a
    zero -= dif//g-1
print("Yes" if zero >= 0 else "No")
0