#P338. 【例58.1】 明明的随机数
【例58.1】 明明的随机数
Description
Ming wants to invite some classmates to participate in a questionnaire survey at school. To ensure the objectivity of the experiment, he first generated random integers between and () using a computer. For any duplicate numbers, he keeps only one and removes the rest, with each unique number corresponding to a different student ID. He then sorts these numbers in ascending order and approaches the students in this order to conduct the survey. Please assist Ming in completing the tasks of "deduplication" and "sorting."
Input Format
The input consists of lines. The first line contains a positive integer , representing the number of random numbers generated.
The second line contains positive integers separated by spaces, representing the generated random numbers.
Output Format
The output consists of lines. The first line contains a positive integer , representing the number of unique random numbers.
The second line contains positive integers separated by spaces, representing the sorted unique random numbers in ascending order.
Sample
10
20 40 32 67 40 20 89 300 400 158
15 20 32 40 67 89 300 400