結果

問題 No.1884 Sequence
ユーザー shinichishinichi
提出日時 2022-03-25 22:20:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 570 bytes
コンパイル時間 356 ms
コンパイル使用メモリ 82,564 KB
実行使用メモリ 137,432 KB
最終ジャッジ日時 2024-04-22 07:00:35
合計ジャッジ時間 7,175 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,760 KB
testcase_01 AC 42 ms
53,868 KB
testcase_02 AC 42 ms
53,504 KB
testcase_03 AC 41 ms
54,016 KB
testcase_04 AC 41 ms
53,760 KB
testcase_05 AC 42 ms
53,504 KB
testcase_06 AC 41 ms
54,144 KB
testcase_07 AC 40 ms
53,504 KB
testcase_08 AC 42 ms
53,888 KB
testcase_09 WA -
testcase_10 AC 224 ms
137,288 KB
testcase_11 AC 226 ms
137,220 KB
testcase_12 AC 74 ms
92,928 KB
testcase_13 AC 78 ms
97,024 KB
testcase_14 AC 83 ms
96,540 KB
testcase_15 AC 150 ms
114,156 KB
testcase_16 AC 184 ms
137,296 KB
testcase_17 AC 108 ms
106,452 KB
testcase_18 AC 132 ms
115,760 KB
testcase_19 AC 113 ms
104,704 KB
testcase_20 AC 136 ms
107,136 KB
testcase_21 AC 122 ms
106,208 KB
testcase_22 AC 149 ms
112,072 KB
testcase_23 AC 183 ms
137,000 KB
testcase_24 AC 185 ms
137,064 KB
testcase_25 AC 184 ms
136,624 KB
testcase_26 AC 190 ms
137,432 KB
testcase_27 AC 84 ms
101,248 KB
testcase_28 AC 85 ms
101,436 KB
testcase_29 AC 83 ms
101,504 KB
testcase_30 AC 84 ms
101,120 KB
testcase_31 AC 130 ms
101,668 KB
testcase_32 WA -
testcase_33 AC 111 ms
103,976 KB
testcase_34 AC 110 ms
104,100 KB
testcase_35 AC 95 ms
104,900 KB
testcase_36 AC 119 ms
99,840 KB
testcase_37 AC 115 ms
104,288 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 181 ms
126,872 KB
testcase_42 AC 172 ms
126,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
from collections import Counter

N = int(input())
A = list(map(int, input().split()))


A.sort()
zeros = A.count(0)
nonzeros = N - zeros
k = 0
for i in range(zeros, N-1):
    a, b = A[i], A[i+1]
    k = math.gcd(k, b - a)

AA = Counter(A)
cant = False
for key, value in AA.items():
    if key != 0 and value >= 2:
        if cant:
            exit(print("No"))
        else:
            cant = True

if k != 0:
    need = (A[-1] - A[zeros]) // k + 1 - nonzeros
    if need <= zeros:
        print("Yes")
    else:
        print("No")
else:
    print("Yes")

0