結果

問題 No.1884 Sequence
ユーザー roarisroaris
提出日時 2022-03-25 23:49:07
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 473 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 82,704 KB
実行使用メモリ 118,900 KB
最終ジャッジ日時 2024-04-22 08:52:36
合計ジャッジ時間 6,008 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
52,196 KB
testcase_01 AC 42 ms
53,264 KB
testcase_02 AC 38 ms
52,832 KB
testcase_03 RE -
testcase_04 AC 37 ms
53,292 KB
testcase_05 AC 39 ms
52,840 KB
testcase_06 AC 37 ms
52,748 KB
testcase_07 AC 38 ms
53,412 KB
testcase_08 AC 38 ms
54,280 KB
testcase_09 AC 38 ms
52,544 KB
testcase_10 AC 185 ms
118,324 KB
testcase_11 AC 185 ms
118,900 KB
testcase_12 AC 65 ms
89,280 KB
testcase_13 AC 68 ms
92,764 KB
testcase_14 AC 70 ms
92,208 KB
testcase_15 AC 117 ms
105,752 KB
testcase_16 AC 153 ms
118,336 KB
testcase_17 AC 92 ms
108,260 KB
testcase_18 AC 98 ms
105,960 KB
testcase_19 AC 93 ms
107,012 KB
testcase_20 AC 109 ms
105,608 KB
testcase_21 AC 102 ms
107,188 KB
testcase_22 AC 113 ms
105,656 KB
testcase_23 AC 153 ms
118,356 KB
testcase_24 AC 152 ms
118,352 KB
testcase_25 AC 154 ms
117,836 KB
testcase_26 AC 153 ms
118,400 KB
testcase_27 RE -
testcase_28 AC 72 ms
96,284 KB
testcase_29 AC 73 ms
97,348 KB
testcase_30 AC 72 ms
96,792 KB
testcase_31 AC 104 ms
103,372 KB
testcase_32 AC 147 ms
117,256 KB
testcase_33 AC 108 ms
115,868 KB
testcase_34 AC 109 ms
115,984 KB
testcase_35 AC 76 ms
100,164 KB
testcase_36 AC 105 ms
106,128 KB
testcase_37 AC 108 ms
116,240 KB
testcase_38 AC 108 ms
114,248 KB
testcase_39 AC 81 ms
103,760 KB
testcase_40 AC 83 ms
104,636 KB
testcase_41 AC 141 ms
110,980 KB
testcase_42 AC 141 ms
110,276 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()

if l[0]==l[-1]:
    exit(print('Yes'))
    
G = 0

for i in range(len(l)-1):
    if l[i]==l[i+1]:
        exit(print('No'))
        
    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