結果

問題 No.1884 Sequence
ユーザー hir355hir355
提出日時 2022-03-25 21:27:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 576 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 118,668 KB
最終ジャッジ日時 2024-04-22 06:02:30
合計ジャッジ時間 6,283 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,712 KB
testcase_01 AC 40 ms
52,224 KB
testcase_02 AC 40 ms
51,968 KB
testcase_03 AC 40 ms
51,968 KB
testcase_04 AC 40 ms
52,096 KB
testcase_05 AC 40 ms
51,968 KB
testcase_06 AC 40 ms
52,096 KB
testcase_07 AC 40 ms
51,840 KB
testcase_08 AC 46 ms
51,584 KB
testcase_09 WA -
testcase_10 AC 197 ms
118,016 KB
testcase_11 AC 194 ms
118,272 KB
testcase_12 AC 74 ms
88,960 KB
testcase_13 AC 81 ms
92,672 KB
testcase_14 AC 78 ms
90,368 KB
testcase_15 AC 127 ms
107,520 KB
testcase_16 AC 162 ms
118,152 KB
testcase_17 AC 98 ms
108,416 KB
testcase_18 AC 108 ms
107,520 KB
testcase_19 AC 103 ms
108,928 KB
testcase_20 AC 118 ms
106,624 KB
testcase_21 AC 105 ms
106,496 KB
testcase_22 AC 124 ms
107,136 KB
testcase_23 AC 164 ms
118,276 KB
testcase_24 AC 165 ms
118,668 KB
testcase_25 AC 163 ms
117,384 KB
testcase_26 AC 164 ms
118,452 KB
testcase_27 AC 80 ms
96,640 KB
testcase_28 AC 84 ms
96,768 KB
testcase_29 AC 83 ms
96,768 KB
testcase_30 AC 82 ms
97,024 KB
testcase_31 AC 121 ms
106,752 KB
testcase_32 WA -
testcase_33 AC 125 ms
116,036 KB
testcase_34 AC 125 ms
116,428 KB
testcase_35 AC 87 ms
99,328 KB
testcase_36 AC 120 ms
106,056 KB
testcase_37 AC 127 ms
116,296 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 97 ms
105,472 KB
testcase_41 AC 151 ms
109,952 KB
testcase_42 AC 152 ms
110,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
n = int(input())
a = list(map(int, input().split()))
b = []
cnt = 0
for x in a:
    if x == 0:
        cnt += 1
    else:
        b.append(x)
b.sort()
if len(b) <= 1:
    print('Yes')
else:
    g = b[1] - b[0]
    for i in range(len(b) - 1):
        if b[i + 1] - b[i] == 0:
            g = 0
        else:
            g = gcd(g, b[i + 1] - b[i])
    if g == 0:
        if b[-1] - b[0] == 0:
            print('Yes')
        else:
            print('No')
    elif (b[-1] - b[0]) // g + 1 - len(b) <= cnt:
        print('Yes')
    else:
        print('No')
0