結果

問題 No.1884 Sequence
ユーザー AEnAEn
提出日時 2022-05-12 14:12:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 530 bytes
コンパイル時間 913 ms
コンパイル使用メモリ 86,464 KB
実行使用メモリ 120,512 KB
最終ジャッジ日時 2023-09-27 13:20:58
合計ジャッジ時間 10,864 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,188 KB
testcase_01 AC 66 ms
71,416 KB
testcase_02 AC 63 ms
71,164 KB
testcase_03 AC 66 ms
71,104 KB
testcase_04 AC 65 ms
71,128 KB
testcase_05 AC 61 ms
71,212 KB
testcase_06 AC 63 ms
71,100 KB
testcase_07 AC 65 ms
71,216 KB
testcase_08 AC 67 ms
71,192 KB
testcase_09 WA -
testcase_10 AC 209 ms
119,588 KB
testcase_11 AC 202 ms
120,084 KB
testcase_12 AC 91 ms
98,068 KB
testcase_13 AC 94 ms
100,848 KB
testcase_14 AC 98 ms
98,460 KB
testcase_15 AC 145 ms
106,232 KB
testcase_16 AC 161 ms
119,780 KB
testcase_17 AC 110 ms
106,860 KB
testcase_18 AC 128 ms
107,228 KB
testcase_19 AC 109 ms
105,380 KB
testcase_20 AC 130 ms
106,872 KB
testcase_21 AC 121 ms
106,576 KB
testcase_22 AC 144 ms
105,080 KB
testcase_23 AC 165 ms
119,900 KB
testcase_24 AC 164 ms
119,604 KB
testcase_25 AC 162 ms
119,136 KB
testcase_26 AC 164 ms
120,512 KB
testcase_27 AC 99 ms
104,172 KB
testcase_28 AC 97 ms
104,204 KB
testcase_29 AC 97 ms
104,208 KB
testcase_30 AC 98 ms
104,404 KB
testcase_31 AC 128 ms
102,192 KB
testcase_32 AC 170 ms
119,416 KB
testcase_33 AC 118 ms
104,368 KB
testcase_34 AC 117 ms
104,472 KB
testcase_35 AC 109 ms
104,728 KB
testcase_36 AC 126 ms
100,232 KB
testcase_37 AC 131 ms
104,352 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 159 ms
113,560 KB
testcase_42 AC 162 ms
113,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

N = int(input())
A = list(map(int, input().split()))
A.sort()
cnt = 0
start = 0
sa = []
for i in range(N):
    if A[i] == 0:
        cnt += 1
    else:
        if start != 0:
            if A[i]-start > 0:
                sa.append(A[i]-start)
        start = A[i]
    if len(sa)==1:
        gcd = sa[0]
    elif len(sa)>1:
        gcd = math.gcd(gcd, sa[-1])
res = 0
if len(sa) == 0:
    print('Yes')
    exit()
for i in range(len(sa)):
    res += (sa[i]//gcd-1)
if cnt >= res:
    print('Yes')
else:
    print('No')
0