結果
問題 |
No.1884 Sequence
|
ユーザー |
![]() |
提出日時 | 2025-02-01 12:14:03 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 479 bytes |
コンパイル時間 | 771 ms |
コンパイル使用メモリ | 82,416 KB |
実行使用メモリ | 132,332 KB |
最終ジャッジ日時 | 2025-02-01 12:14:16 |
合計ジャッジ時間 | 10,250 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 WA * 5 RE * 4 |
ソースコード
from math import gcd N = int(input()) A = list(map(int,input().split())) A.sort() c0 = 0 pre = 0 D = [] A2 = [] for a in A: if a == 0: c0 += 1 else: A2.append(a) if pre != 0: D.append(a - pre) pre = a amin= min(A2) amax = max(A2) N2 = len(A2) dmin= min(D) if amin == amax: print("Yes") exit() n0 = N - c0 g = 0 for d in D: g = gcd(g,d) x = (amax - amin) // g + 1 if N >= x: print("Yes") else: print("No")