結果

問題 No.1884 Sequence
ユーザー minimumminimum
提出日時 2022-03-25 21:35:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 175 ms / 2,000 ms
コード長 477 bytes
コンパイル時間 355 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 108,800 KB
最終ジャッジ日時 2024-04-22 06:14:34
合計ジャッジ時間 6,243 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,096 KB
testcase_01 AC 40 ms
52,096 KB
testcase_02 AC 38 ms
51,712 KB
testcase_03 AC 39 ms
52,352 KB
testcase_04 AC 40 ms
52,224 KB
testcase_05 AC 39 ms
52,352 KB
testcase_06 AC 39 ms
51,840 KB
testcase_07 AC 38 ms
51,712 KB
testcase_08 AC 39 ms
51,968 KB
testcase_09 AC 38 ms
52,352 KB
testcase_10 AC 175 ms
104,736 KB
testcase_11 AC 171 ms
104,860 KB
testcase_12 AC 67 ms
88,832 KB
testcase_13 AC 69 ms
92,608 KB
testcase_14 AC 73 ms
90,240 KB
testcase_15 AC 117 ms
108,600 KB
testcase_16 AC 140 ms
104,820 KB
testcase_17 AC 85 ms
103,424 KB
testcase_18 AC 95 ms
108,800 KB
testcase_19 AC 84 ms
101,632 KB
testcase_20 AC 111 ms
105,984 KB
testcase_21 AC 98 ms
102,528 KB
testcase_22 AC 115 ms
107,648 KB
testcase_23 AC 142 ms
104,544 KB
testcase_24 AC 139 ms
104,232 KB
testcase_25 AC 138 ms
103,328 KB
testcase_26 AC 139 ms
104,760 KB
testcase_27 AC 75 ms
97,024 KB
testcase_28 AC 74 ms
97,024 KB
testcase_29 AC 74 ms
96,768 KB
testcase_30 AC 75 ms
96,896 KB
testcase_31 AC 100 ms
98,944 KB
testcase_32 AC 137 ms
103,796 KB
testcase_33 AC 98 ms
102,712 KB
testcase_34 AC 98 ms
102,248 KB
testcase_35 AC 81 ms
98,432 KB
testcase_36 AC 106 ms
102,400 KB
testcase_37 AC 99 ms
102,252 KB
testcase_38 AC 98 ms
100,488 KB
testcase_39 AC 89 ms
101,248 KB
testcase_40 AC 90 ms
102,144 KB
testcase_41 AC 133 ms
100,608 KB
testcase_42 AC 134 ms
100,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math


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

A.sort()
g = 0
z_cnt = 0

for i in range(N):
    if A[i] == 0:
        z_cnt += 1
    else:
        break

if z_cnt >= N - 1:
    print('Yes')
else:
    g = A[i + 1] - A[i]
    for j in range(i, N - 1):
        if A[j + 1] - A[j] == 0:
            g = 0
            break
        g = math.gcd(A[j + 1] - A[j], g)
    d = A[-1] - A[i]
    if g * (N - 1) >= d:
        print('Yes')
    else:
        print('No')
0