結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
52,224 KB
testcase_01 AC 41 ms
52,224 KB
testcase_02 AC 41 ms
51,456 KB
testcase_03 AC 41 ms
51,712 KB
testcase_04 AC 41 ms
51,712 KB
testcase_05 AC 42 ms
51,840 KB
testcase_06 WA -
testcase_07 AC 41 ms
52,352 KB
testcase_08 AC 41 ms
51,968 KB
testcase_09 WA -
testcase_10 AC 255 ms
149,836 KB
testcase_11 AC 257 ms
149,968 KB
testcase_12 AC 75 ms
88,576 KB
testcase_13 AC 79 ms
92,800 KB
testcase_14 AC 86 ms
92,800 KB
testcase_15 AC 157 ms
108,288 KB
testcase_16 AC 216 ms
149,752 KB
testcase_17 AC 118 ms
106,368 KB
testcase_18 AC 138 ms
108,288 KB
testcase_19 AC 125 ms
104,064 KB
testcase_20 AC 148 ms
107,264 KB
testcase_21 AC 131 ms
106,240 KB
testcase_22 AC 154 ms
107,264 KB
testcase_23 AC 218 ms
149,460 KB
testcase_24 AC 216 ms
149,724 KB
testcase_25 AC 220 ms
148,816 KB
testcase_26 AC 224 ms
150,280 KB
testcase_27 AC 83 ms
96,256 KB
testcase_28 AC 83 ms
96,384 KB
testcase_29 AC 82 ms
96,512 KB
testcase_30 AC 83 ms
96,512 KB
testcase_31 AC 144 ms
107,348 KB
testcase_32 AC 235 ms
178,724 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 98 ms
100,480 KB
testcase_36 AC 134 ms
107,184 KB
testcase_37 AC 138 ms
116,380 KB
testcase_38 WA -
testcase_39 AC 107 ms
104,960 KB
testcase_40 AC 111 ms
107,136 KB
testcase_41 AC 199 ms
133,364 KB
testcase_42 AC 199 ms
133,036 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_ = sa[0]
    for i in range(1,len(sa)):
        gcd_ = math.gcd(gcd_,sa[i])
    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