結果

問題 No.1884 Sequence
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-03-25 22:12:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 482 bytes
コンパイル時間 456 ms
コンパイル使用メモリ 82,572 KB
実行使用メモリ 111,296 KB
最終ジャッジ日時 2024-04-22 06:51:35
合計ジャッジ時間 6,605 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,096 KB
testcase_01 AC 40 ms
51,712 KB
testcase_02 AC 39 ms
51,584 KB
testcase_03 AC 39 ms
51,840 KB
testcase_04 AC 39 ms
52,224 KB
testcase_05 AC 39 ms
51,712 KB
testcase_06 AC 39 ms
52,352 KB
testcase_07 AC 39 ms
51,840 KB
testcase_08 AC 39 ms
51,840 KB
testcase_09 WA -
testcase_10 AC 186 ms
111,040 KB
testcase_11 AC 184 ms
110,600 KB
testcase_12 AC 70 ms
89,728 KB
testcase_13 AC 72 ms
93,440 KB
testcase_14 AC 79 ms
92,288 KB
testcase_15 AC 125 ms
109,824 KB
testcase_16 AC 148 ms
110,612 KB
testcase_17 AC 92 ms
107,392 KB
testcase_18 AC 103 ms
110,336 KB
testcase_19 AC 93 ms
106,152 KB
testcase_20 AC 119 ms
110,336 KB
testcase_21 AC 106 ms
105,856 KB
testcase_22 AC 126 ms
110,660 KB
testcase_23 AC 148 ms
110,356 KB
testcase_24 AC 145 ms
110,104 KB
testcase_25 AC 152 ms
110,036 KB
testcase_26 AC 150 ms
111,296 KB
testcase_27 AC 78 ms
98,176 KB
testcase_28 AC 77 ms
98,176 KB
testcase_29 AC 78 ms
98,560 KB
testcase_30 AC 78 ms
98,432 KB
testcase_31 AC 111 ms
103,424 KB
testcase_32 WA -
testcase_33 AC 112 ms
107,092 KB
testcase_34 AC 110 ms
107,548 KB
testcase_35 AC 88 ms
100,992 KB
testcase_36 AC 116 ms
102,200 KB
testcase_37 AC 118 ms
109,396 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 146 ms
104,952 KB
testcase_42 AC 145 ms
104,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
n = int(input())
A = sorted(list(map(int,input().split())))
zero = 0
nA = [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