結果

問題 No.1884 Sequence
ユーザー とりゐとりゐ
提出日時 2022-03-25 21:24:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 812 bytes
コンパイル時間 424 ms
コンパイル使用メモリ 82,312 KB
実行使用メモリ 118,956 KB
最終ジャッジ日時 2024-04-22 05:57:37
合計ジャッジ時間 6,278 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
55,332 KB
testcase_01 AC 42 ms
54,044 KB
testcase_02 AC 43 ms
55,120 KB
testcase_03 AC 42 ms
55,068 KB
testcase_04 AC 42 ms
54,540 KB
testcase_05 AC 45 ms
55,840 KB
testcase_06 AC 42 ms
55,012 KB
testcase_07 AC 42 ms
55,340 KB
testcase_08 AC 43 ms
54,880 KB
testcase_09 WA -
testcase_10 AC 169 ms
118,824 KB
testcase_11 AC 171 ms
118,192 KB
testcase_12 AC 72 ms
91,836 KB
testcase_13 AC 75 ms
96,732 KB
testcase_14 AC 73 ms
92,612 KB
testcase_15 AC 121 ms
104,936 KB
testcase_16 AC 137 ms
118,224 KB
testcase_17 AC 97 ms
105,572 KB
testcase_18 AC 117 ms
106,144 KB
testcase_19 AC 100 ms
102,736 KB
testcase_20 AC 109 ms
105,892 KB
testcase_21 AC 101 ms
105,208 KB
testcase_22 AC 122 ms
104,084 KB
testcase_23 AC 143 ms
118,956 KB
testcase_24 AC 142 ms
118,452 KB
testcase_25 AC 143 ms
117,024 KB
testcase_26 AC 144 ms
117,728 KB
testcase_27 AC 78 ms
99,308 KB
testcase_28 AC 80 ms
98,852 KB
testcase_29 AC 82 ms
100,104 KB
testcase_30 AC 80 ms
100,288 KB
testcase_31 AC 102 ms
100,080 KB
testcase_32 WA -
testcase_33 AC 116 ms
118,024 KB
testcase_34 AC 114 ms
118,036 KB
testcase_35 AC 81 ms
101,684 KB
testcase_36 AC 112 ms
106,952 KB
testcase_37 AC 118 ms
118,896 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 131 ms
113,040 KB
testcase_42 AC 137 ms
112,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math
from collections import deque,Counter
from sys import stdin

#sys.setrecursionlimit(10**7)

int1=lambda x: int(x)-1
stinput=lambda :stdin.readline()[:-1]
ii=lambda :int(stinput())
mi=lambda :map(int, stdin.readline().split())
li=lambda :list(mi())
mi1=lambda :map(int1, stdin.readline().split())
li1=lambda :list(mi1())
mis=lambda :map(str, stdin.readline().split())
lis=lambda :list(mis())

from collections import defaultdict
#d=defaultdict(int)
#d=defaultdict(lambda:1)

mod=10**9+7
Mod=998244353
INF=10**18
ans=0

n=ii()
a=li()
x=-1
g=0
cnt=0
c=[]
for i in a:
  if i!=0:
    c.append(i)
    if x==-1:
      x=i
    else:
      g=math.gcd(g,x-i)
  else:
    cnt+=1
if len(c)==0 or g==0:
  print('Yes')
  exit()

mx=max(c)
mn=min(c)
if (mx-mn)//g+1<=n:
  print('Yes')
else:
  print('No')
0