結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,096 KB
testcase_01 AC 38 ms
52,096 KB
testcase_02 AC 39 ms
52,096 KB
testcase_03 AC 38 ms
51,712 KB
testcase_04 AC 38 ms
52,608 KB
testcase_05 AC 38 ms
51,968 KB
testcase_06 AC 38 ms
52,480 KB
testcase_07 AC 38 ms
51,840 KB
testcase_08 AC 37 ms
51,712 KB
testcase_09 WA -
testcase_10 AC 185 ms
118,288 KB
testcase_11 AC 185 ms
118,496 KB
testcase_12 AC 68 ms
89,216 KB
testcase_13 AC 70 ms
92,672 KB
testcase_14 AC 70 ms
90,624 KB
testcase_15 AC 120 ms
107,520 KB
testcase_16 AC 152 ms
117,788 KB
testcase_17 AC 90 ms
107,776 KB
testcase_18 AC 98 ms
108,288 KB
testcase_19 AC 95 ms
109,056 KB
testcase_20 AC 109 ms
106,576 KB
testcase_21 AC 97 ms
105,984 KB
testcase_22 AC 117 ms
107,216 KB
testcase_23 AC 156 ms
118,292 KB
testcase_24 AC 154 ms
118,564 KB
testcase_25 AC 154 ms
117,572 KB
testcase_26 AC 153 ms
118,084 KB
testcase_27 AC 74 ms
96,640 KB
testcase_28 AC 76 ms
97,152 KB
testcase_29 AC 76 ms
97,536 KB
testcase_30 AC 76 ms
96,768 KB
testcase_31 AC 108 ms
106,368 KB
testcase_32 WA -
testcase_33 AC 119 ms
116,372 KB
testcase_34 AC 117 ms
116,436 KB
testcase_35 AC 80 ms
100,608 KB
testcase_36 AC 113 ms
106,156 KB
testcase_37 AC 119 ms
116,756 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 143 ms
110,324 KB
testcase_42 AC 142 ms
109,872 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):
        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