結果
問題 |
No.1884 Sequence
|
ユーザー |
![]() |
提出日時 | 2022-03-25 21:24:07 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 812 bytes |
コンパイル時間 | 178 ms |
コンパイル使用メモリ | 82,544 KB |
実行使用メモリ | 118,792 KB |
最終ジャッジ日時 | 2024-10-14 05:11:42 |
合計ジャッジ時間 | 6,036 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 35 WA * 5 |
ソースコード
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')