結果

問題 No.1884 Sequence
ユーザー MasKoaTSMasKoaTS
提出日時 2022-03-25 21:33:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 976 bytes
コンパイル時間 462 ms
コンパイル使用メモリ 82,352 KB
実行使用メモリ 137,164 KB
最終ジャッジ日時 2024-04-22 06:11:19
合計ジャッジ時間 10,860 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
86,784 KB
testcase_01 AC 129 ms
86,784 KB
testcase_02 AC 132 ms
86,528 KB
testcase_03 AC 130 ms
86,656 KB
testcase_04 AC 132 ms
86,564 KB
testcase_05 AC 131 ms
86,912 KB
testcase_06 AC 135 ms
86,996 KB
testcase_07 AC 133 ms
87,040 KB
testcase_08 AC 135 ms
86,912 KB
testcase_09 WA -
testcase_10 AC 279 ms
136,960 KB
testcase_11 AC 279 ms
136,960 KB
testcase_12 AC 165 ms
109,956 KB
testcase_13 AC 168 ms
113,024 KB
testcase_14 AC 170 ms
110,016 KB
testcase_15 AC 220 ms
126,108 KB
testcase_16 AC 245 ms
136,756 KB
testcase_17 AC 186 ms
121,600 KB
testcase_18 AC 198 ms
127,616 KB
testcase_19 AC 187 ms
121,472 KB
testcase_20 AC 208 ms
123,520 KB
testcase_21 AC 198 ms
120,568 KB
testcase_22 AC 213 ms
124,796 KB
testcase_23 AC 242 ms
137,088 KB
testcase_24 AC 240 ms
136,320 KB
testcase_25 AC 241 ms
136,248 KB
testcase_26 AC 247 ms
137,088 KB
testcase_27 AC 169 ms
115,840 KB
testcase_28 AC 171 ms
115,712 KB
testcase_29 AC 176 ms
115,712 KB
testcase_30 AC 171 ms
115,712 KB
testcase_31 AC 202 ms
118,528 KB
testcase_32 WA -
testcase_33 AC 200 ms
135,424 KB
testcase_34 AC 205 ms
135,676 KB
testcase_35 AC 182 ms
116,096 KB
testcase_36 AC 204 ms
128,256 KB
testcase_37 AC 206 ms
135,300 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 234 ms
132,352 KB
testcase_42 AC 234 ms
131,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools as iter
import collections as coll
import heapq as hq
import bisect as bis
from decimal import Decimal as dec
from functools import cmp_to_key
import math
import sys
#import pypyjit
#pypyjit.set_param('max_unroll_recursion=-1')
sys.setrecursionlimit(10 ** 6)
inp = sys.stdin.readline
input = lambda : inp().rstrip()
getN = lambda : int(inp())
getNs = lambda : map(int, inp().split())
getList = lambda :list(map(int, inp().split()))
getStrs = lambda n : [input() for _ in [0] * n]
def yexit(): print("Yes"); exit(0)
def nexit(): print("No"); exit(0)
pi = 3.141592653589793
mod = 1000000007
MOD = 998244353
INF = 4611686018427387903
dx = [1, 0, -1, 0];	dy = [0, 1, 0, -1]


"""
Main Code
"""

n = getN()
a = sorted(getNs())

cnt = G = 0
d = []
for i in range(n - 1):
	if(a[i] == 0):
		cnt += 1
		continue
	d.append(a[i + 1] - a[i])
	G = math.gcd(G, d[-1])

if(G == 0):
	yexit()

#print(G, d)
for i in d:
	cnt -= i // G - 1
if(cnt >= 0):
	yexit()
else:
	nexit()
0