結果

問題 No.1884 Sequence
ユーザー roarisroaris
提出日時 2022-03-25 23:20:32
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 368 bytes
コンパイル時間 338 ms
コンパイル使用メモリ 82,320 KB
実行使用メモリ 118,360 KB
最終ジャッジ日時 2024-04-22 08:16:38
合計ジャッジ時間 6,274 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,464 KB
testcase_01 AC 37 ms
52,860 KB
testcase_02 AC 37 ms
52,260 KB
testcase_03 AC 38 ms
53,508 KB
testcase_04 AC 37 ms
52,308 KB
testcase_05 AC 37 ms
53,332 KB
testcase_06 AC 38 ms
52,652 KB
testcase_07 AC 38 ms
52,880 KB
testcase_08 AC 37 ms
52,816 KB
testcase_09 WA -
testcase_10 AC 187 ms
118,360 KB
testcase_11 AC 187 ms
118,248 KB
testcase_12 AC 66 ms
88,764 KB
testcase_13 AC 69 ms
92,840 KB
testcase_14 AC 70 ms
91,704 KB
testcase_15 AC 115 ms
106,100 KB
testcase_16 AC 151 ms
118,276 KB
testcase_17 AC 90 ms
108,176 KB
testcase_18 AC 97 ms
105,944 KB
testcase_19 AC 92 ms
107,580 KB
testcase_20 AC 108 ms
105,432 KB
testcase_21 AC 100 ms
107,252 KB
testcase_22 AC 113 ms
105,100 KB
testcase_23 AC 153 ms
118,124 KB
testcase_24 AC 153 ms
118,272 KB
testcase_25 AC 152 ms
117,364 KB
testcase_26 AC 154 ms
118,320 KB
testcase_27 AC 72 ms
96,844 KB
testcase_28 AC 72 ms
96,164 KB
testcase_29 AC 73 ms
96,964 KB
testcase_30 AC 72 ms
96,580 KB
testcase_31 AC 106 ms
103,724 KB
testcase_32 WA -
testcase_33 AC 111 ms
116,508 KB
testcase_34 AC 111 ms
116,288 KB
testcase_35 AC 77 ms
100,400 KB
testcase_36 AC 107 ms
106,656 KB
testcase_37 AC 117 ms
116,788 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 142 ms
110,440 KB
testcase_42 AC 141 ms
110,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from math import gcd

N = int(input())
A = list(map(int, input().split()))
l = [Ai for Ai in A if Ai>0]
l.sort()
G = 0

for i in range(len(l)-1):
    G = gcd(G, l[i+1]-l[i])

if G==0:
    exit(print('Yes'))

cnt = 0

for i in range(len(l)-1):
    cnt += (l[i+1]-l[i])//G-1

if cnt<=N-len(l):
    print('Yes')
else:
    print('No')
0