結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 37 ms
52,096 KB
testcase_03 AC 38 ms
51,456 KB
testcase_04 AC 37 ms
51,584 KB
testcase_05 AC 37 ms
52,096 KB
testcase_06 AC 37 ms
52,096 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 38 ms
52,096 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 75 ms
98,304 KB
testcase_28 AC 75 ms
98,176 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 178 ms
140,716 KB
testcase_33 AC 102 ms
105,504 KB
testcase_34 AC 101 ms
104,924 KB
testcase_35 AC 81 ms
100,352 KB
testcase_36 AC 108 ms
101,888 KB
testcase_37 WA -
testcase_38 AC 111 ms
107,696 KB
testcase_39 AC 94 ms
105,472 KB
testcase_40 AC 97 ms
106,624 KB
testcase_41 WA -
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

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("No" if zero >= 0 else "Yes")
0