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