結果

問題 No.1884 Sequence
ユーザー kept1994kept1994
提出日時 2022-04-23 23:58:28
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 634 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 87,288 KB
実行使用メモリ 133,728 KB
最終ジャッジ日時 2023-09-07 15:07:07
合計ジャッジ時間 8,987 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,384 KB
testcase_01 AC 72 ms
71,552 KB
testcase_02 AC 72 ms
71,376 KB
testcase_03 AC 72 ms
71,632 KB
testcase_04 AC 72 ms
71,112 KB
testcase_05 AC 71 ms
71,544 KB
testcase_06 AC 72 ms
71,484 KB
testcase_07 AC 73 ms
71,576 KB
testcase_08 AC 72 ms
71,556 KB
testcase_09 WA -
testcase_10 AC 230 ms
133,564 KB
testcase_11 AC 232 ms
133,492 KB
testcase_12 AC 100 ms
97,684 KB
testcase_13 AC 104 ms
100,424 KB
testcase_14 AC 104 ms
98,484 KB
testcase_15 AC 158 ms
112,440 KB
testcase_16 AC 191 ms
133,512 KB
testcase_17 AC 123 ms
106,660 KB
testcase_18 AC 145 ms
113,848 KB
testcase_19 AC 127 ms
104,376 KB
testcase_20 AC 143 ms
107,236 KB
testcase_21 AC 130 ms
106,272 KB
testcase_22 AC 157 ms
110,872 KB
testcase_23 AC 194 ms
133,312 KB
testcase_24 AC 192 ms
133,728 KB
testcase_25 AC 193 ms
133,256 KB
testcase_26 AC 193 ms
133,532 KB
testcase_27 AC 105 ms
104,096 KB
testcase_28 AC 106 ms
104,024 KB
testcase_29 AC 108 ms
104,196 KB
testcase_30 AC 105 ms
104,140 KB
testcase_31 AC 138 ms
101,648 KB
testcase_32 WA -
testcase_33 AC 151 ms
131,828 KB
testcase_34 AC 156 ms
131,492 KB
testcase_35 AC 113 ms
105,788 KB
testcase_36 AC 145 ms
115,996 KB
testcase_37 AC 155 ms
132,016 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 176 ms
123,964 KB
testcase_42 AC 179 ms
123,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys
import math

def main():
    N = int(input())
    A = list(map(int, input().split()))
    aa = []
    zero = 0
    for i in A:
        if i != 0:
            aa.append(i)
        else:
            zero += 1
    aa.sort()
    diff = []
    g = 0
    for i in range(len(aa) - 1):
        diff.append(aa[i + 1] - aa[i])
        g = math.gcd(g, aa[i + 1] - aa[i])

    if g == 0:
        print("Yes")
        return
    
    ans = 0
    for d in diff:
        ans += d // g - 1
    # print(ans)
    if ans <= zero:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()
0