結果

問題 No.1884 Sequence
ユーザー tassei903tassei903
提出日時 2022-03-25 22:49:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 797 bytes
コンパイル時間 445 ms
コンパイル使用メモリ 82,504 KB
実行使用メモリ 148,960 KB
最終ジャッジ日時 2024-04-22 07:35:51
合計ジャッジ時間 7,456 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 37 ms
52,352 KB
testcase_02 AC 37 ms
52,224 KB
testcase_03 AC 38 ms
51,712 KB
testcase_04 AC 38 ms
52,224 KB
testcase_05 AC 39 ms
52,480 KB
testcase_06 AC 38 ms
51,712 KB
testcase_07 AC 37 ms
51,840 KB
testcase_08 WA -
testcase_09 AC 38 ms
52,096 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 78 ms
92,416 KB
testcase_15 AC 171 ms
107,644 KB
testcase_16 AC 181 ms
120,156 KB
testcase_17 WA -
testcase_18 AC 119 ms
108,160 KB
testcase_19 AC 106 ms
110,208 KB
testcase_20 AC 155 ms
107,208 KB
testcase_21 AC 126 ms
108,672 KB
testcase_22 AC 161 ms
107,136 KB
testcase_23 WA -
testcase_24 AC 199 ms
119,712 KB
testcase_25 AC 208 ms
118,820 KB
testcase_26 WA -
testcase_27 AC 75 ms
96,640 KB
testcase_28 AC 78 ms
97,664 KB
testcase_29 AC 77 ms
96,640 KB
testcase_30 AC 85 ms
99,584 KB
testcase_31 AC 150 ms
107,520 KB
testcase_32 AC 233 ms
148,960 KB
testcase_33 AC 121 ms
117,788 KB
testcase_34 AC 121 ms
117,980 KB
testcase_35 AC 88 ms
101,504 KB
testcase_36 AC 122 ms
107,208 KB
testcase_37 AC 125 ms
118,436 KB
testcase_38 AC 124 ms
116,256 KB
testcase_39 AC 100 ms
107,136 KB
testcase_40 AC 106 ms
108,800 KB
testcase_41 AC 208 ms
134,568 KB
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################

from math import gcd
n = ni()
c = 0
a = na()
b = []
for i in a:
    if i == 0:
        c += 1
    else:
        b.append(i)
b = sorted(b)
m = len(b)
if m<=2:
    Yes()
    exit()

z = 0
f = 1
for i in range(n-1):
    z = gcd(z, a[i+1]-a[i])
    if a[i+1]==a[i]:
        f = 0

if f^1:
    if len(set(b))==1:
        Yes()
    else:
        No()
    exit()

for i in range(n-1):
    c -= (a[i+1]-a[i])//z - 1
if c >= 0:
    Yes()
else:
    No()
0