結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 36 ms
52,096 KB
testcase_02 AC 37 ms
51,968 KB
testcase_03 AC 37 ms
52,352 KB
testcase_04 AC 36 ms
51,968 KB
testcase_05 AC 35 ms
52,224 KB
testcase_06 AC 37 ms
51,840 KB
testcase_07 WA -
testcase_08 AC 37 ms
51,968 KB
testcase_09 AC 37 ms
52,352 KB
testcase_10 AC 212 ms
141,836 KB
testcase_11 AC 208 ms
142,172 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 76 ms
92,800 KB
testcase_15 AC 135 ms
109,952 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 113 ms
109,952 KB
testcase_19 AC 104 ms
120,448 KB
testcase_20 AC 127 ms
120,832 KB
testcase_21 AC 114 ms
115,200 KB
testcase_22 AC 131 ms
109,568 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 176 ms
140,968 KB
testcase_26 AC 176 ms
142,148 KB
testcase_27 AC 76 ms
98,176 KB
testcase_28 AC 74 ms
98,048 KB
testcase_29 WA -
testcase_30 AC 75 ms
98,176 KB
testcase_31 AC 120 ms
116,608 KB
testcase_32 AC 179 ms
141,156 KB
testcase_33 AC 103 ms
105,432 KB
testcase_34 AC 102 ms
105,240 KB
testcase_35 AC 82 ms
100,224 KB
testcase_36 AC 109 ms
101,632 KB
testcase_37 AC 115 ms
108,888 KB
testcase_38 AC 112 ms
107,308 KB
testcase_39 AC 95 ms
105,472 KB
testcase_40 AC 98 ms
107,008 KB
testcase_41 AC 163 ms
127,776 KB
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 "No")
0