結果

問題 No.1884 Sequence
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-03-25 22:22:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 456 bytes
コンパイル時間 420 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 142,348 KB
最終ジャッジ日時 2024-04-22 07:03:26
合計ジャッジ時間 7,427 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,096 KB
testcase_01 AC 40 ms
52,224 KB
testcase_02 AC 41 ms
51,456 KB
testcase_03 AC 40 ms
51,456 KB
testcase_04 AC 40 ms
51,968 KB
testcase_05 AC 40 ms
51,968 KB
testcase_06 AC 40 ms
51,456 KB
testcase_07 AC 45 ms
51,712 KB
testcase_08 AC 42 ms
51,840 KB
testcase_09 WA -
testcase_10 AC 231 ms
141,968 KB
testcase_11 AC 228 ms
142,348 KB
testcase_12 AC 75 ms
89,728 KB
testcase_13 AC 78 ms
93,056 KB
testcase_14 AC 83 ms
92,928 KB
testcase_15 AC 145 ms
109,696 KB
testcase_16 AC 185 ms
141,476 KB
testcase_17 AC 113 ms
118,272 KB
testcase_18 AC 125 ms
109,824 KB
testcase_19 AC 116 ms
120,448 KB
testcase_20 AC 138 ms
120,960 KB
testcase_21 AC 124 ms
115,328 KB
testcase_22 AC 156 ms
109,824 KB
testcase_23 AC 186 ms
141,336 KB
testcase_24 AC 185 ms
141,332 KB
testcase_25 AC 189 ms
140,816 KB
testcase_26 AC 190 ms
142,148 KB
testcase_27 AC 84 ms
98,048 KB
testcase_28 AC 82 ms
98,432 KB
testcase_29 AC 82 ms
97,792 KB
testcase_30 AC 82 ms
97,920 KB
testcase_31 AC 132 ms
116,096 KB
testcase_32 WA -
testcase_33 AC 116 ms
105,304 KB
testcase_34 AC 114 ms
105,172 KB
testcase_35 AC 91 ms
99,968 KB
testcase_36 AC 119 ms
102,016 KB
testcase_37 AC 127 ms
109,140 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 174 ms
127,608 KB
testcase_42 AC 175 ms
127,732 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(set(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("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