結果

問題 No.1884 Sequence
ユーザー 👑 H20H20
提出日時 2022-03-25 21:43:26
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 511 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 182,128 KB
最終ジャッジ日時 2024-04-22 06:24:06
合計ジャッジ時間 8,003 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,632 KB
testcase_01 AC 40 ms
53,376 KB
testcase_02 AC 40 ms
53,632 KB
testcase_03 RE -
testcase_04 AC 41 ms
53,504 KB
testcase_05 AC 41 ms
53,504 KB
testcase_06 AC 40 ms
53,120 KB
testcase_07 AC 41 ms
53,760 KB
testcase_08 AC 41 ms
53,248 KB
testcase_09 AC 42 ms
53,376 KB
testcase_10 AC 263 ms
181,944 KB
testcase_11 AC 263 ms
182,128 KB
testcase_12 AC 93 ms
97,792 KB
testcase_13 AC 97 ms
100,736 KB
testcase_14 AC 100 ms
98,048 KB
testcase_15 AC 187 ms
134,568 KB
testcase_16 AC 249 ms
182,088 KB
testcase_17 AC 134 ms
105,984 KB
testcase_18 AC 163 ms
138,312 KB
testcase_19 AC 143 ms
109,036 KB
testcase_20 AC 160 ms
106,496 KB
testcase_21 AC 140 ms
105,600 KB
testcase_22 AC 171 ms
130,264 KB
testcase_23 AC 245 ms
182,088 KB
testcase_24 AC 248 ms
181,972 KB
testcase_25 AC 229 ms
181,672 KB
testcase_26 AC 237 ms
181,884 KB
testcase_27 RE -
testcase_28 AC 91 ms
102,272 KB
testcase_29 AC 90 ms
102,400 KB
testcase_30 AC 102 ms
104,448 KB
testcase_31 AC 149 ms
109,340 KB
testcase_32 AC 241 ms
181,492 KB
testcase_33 AC 126 ms
118,300 KB
testcase_34 AC 126 ms
118,168 KB
testcase_35 AC 97 ms
104,192 KB
testcase_36 AC 123 ms
107,132 KB
testcase_37 AC 131 ms
118,428 KB
testcase_38 AC 127 ms
116,368 KB
testcase_39 AC 102 ms
105,216 KB
testcase_40 AC 103 ms
105,600 KB
testcase_41 AC 222 ms
160,440 KB
testcase_42 AC 236 ms
160,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
import math


N = int(input())
A = list(map(int, input().split())) 
CA = collections.Counter(A)
B = []
for a in A:
    if a!=0:
        B.append(a)
B.sort()

CB= collections.Counter(B)
if len(CB)==1:
    print('Yes')
    exit()
temp = 0
for i in range(len(B)-1):
    if B[i+1]-B[i]==0:
        print('No')
        exit()
    temp = math.gcd(temp,B[i+1]-B[i])
v = B[0]
while CA[0]>=0 and v<B[-1]:
    if CA[v]==0:
        CA[0]-=1
    v+=temp
if CA[0]<0:
    print('No')
else:
    print('Yes')
0