結果

問題 No.1884 Sequence
ユーザー SidewaysOwlSidewaysOwl
提出日時 2022-03-25 21:49:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 700 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 82,524 KB
実行使用メモリ 178,652 KB
最終ジャッジ日時 2024-04-22 06:30:37
合計ジャッジ時間 7,305 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,840 KB
testcase_01 AC 39 ms
52,224 KB
testcase_02 AC 38 ms
51,840 KB
testcase_03 AC 40 ms
52,224 KB
testcase_04 AC 39 ms
51,968 KB
testcase_05 AC 38 ms
51,712 KB
testcase_06 WA -
testcase_07 AC 39 ms
51,968 KB
testcase_08 AC 38 ms
52,224 KB
testcase_09 WA -
testcase_10 AC 237 ms
149,708 KB
testcase_11 AC 236 ms
150,224 KB
testcase_12 AC 69 ms
88,832 KB
testcase_13 AC 74 ms
92,288 KB
testcase_14 AC 82 ms
92,800 KB
testcase_15 AC 145 ms
108,160 KB
testcase_16 AC 196 ms
149,848 KB
testcase_17 AC 107 ms
106,496 KB
testcase_18 AC 126 ms
108,672 KB
testcase_19 AC 113 ms
104,320 KB
testcase_20 AC 137 ms
107,724 KB
testcase_21 AC 118 ms
106,368 KB
testcase_22 AC 141 ms
107,520 KB
testcase_23 AC 196 ms
149,976 KB
testcase_24 AC 195 ms
149,344 KB
testcase_25 AC 195 ms
148,880 KB
testcase_26 AC 199 ms
150,280 KB
testcase_27 AC 76 ms
97,152 KB
testcase_28 AC 76 ms
97,280 KB
testcase_29 AC 78 ms
96,896 KB
testcase_30 AC 78 ms
96,768 KB
testcase_31 AC 137 ms
107,116 KB
testcase_32 AC 231 ms
178,652 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 90 ms
100,224 KB
testcase_36 AC 125 ms
107,012 KB
testcase_37 AC 123 ms
116,504 KB
testcase_38 WA -
testcase_39 AC 98 ms
105,380 KB
testcase_40 AC 101 ms
107,008 KB
testcase_41 AC 180 ms
134,000 KB
testcase_42 AC 185 ms
133,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int,input().split()))
a.sort()
cnt = 0
idx = -1
sa = [0]
same = set()
flg = False
for i in range(n):
    if idx ==-1 and a[i] != 0:
        idx = i
        same.add(a[i])
    elif idx != -1:
        if a[i] in same:
            flg = True
        sa.append(a[i]-a[idx])
        same.add(a[i])
    else:
        cnt += 1
if flg:
    if len(set(a)) == 2:
        print("Yes")
    else:
        print("No")
else:
    import math
    gcd_ = 0
    for i in range(1,len(sa)):
        gcd_ = math.gcd(gcd_,sa[i]-sa[i-1])
    baf = 0 
    for i in range(1,len(sa)):
        baf += (sa[i] - sa[i-1])//gcd_ - 1
    if baf <= cnt:
        print("Yes")
    else:
        print("No")
0