#K51. Unique Sorted Array

    ID: 28989 Type: Default 1000ms 256MiB

Unique Sorted Array

Unique Sorted Array

You are given an array of integers. Your task is to output the unique elements from the array sorted in ascending order. All duplicate elements should be removed.

The solution must read input from standard input (stdin) and write the result to standard output (stdout).

The answer should use the \(\texttt{numpy.unique}\) functionality (for Python) or an equivalent approach in other programming languages.

inputFormat

The input consists of two lines:

  • The first line contains a single integer \(n\) \((0 \le n \le 10^5)\), representing the number of elements in the array.
  • The second line contains \(n\) space-separated integers.

outputFormat

Output a single line containing the unique elements in ascending order, separated by a single space. If the array is empty (\(n = 0\)), output an empty line.

## sample
9
2 3 2 1 3 4 5 1 5
1 2 3 4 5