You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given an array <i>a</i> of <i>n</i> numbers. Find the minimum number of numbers after deleting which the pairwise difference of the remaining
22
+
numbers modulo will not exceed 1, that is, after deleting, no number should differ from any other by more than 1.
23
+
24
+
## Input format
25
+
The first line contains a single integer <i>n</i> (1 ≤ <i>n</i> ≤ 2·10<sup>5</sup>) — the number of elements of the array <
10000
i>a</i>.
26
+
27
+
The second line contains <i>n</i> integers <i>a<sub>1</sub></i>, <i>a<sub>2</sub></i>, …, <i>a<sub>n</sub></i> (0 ≤ <i>a<sub>i</sub></i>≤ 10<sup>5</sup>) — elements of the array <i>a</i>.
0 commit comments