#T160. 明明的随机数
明明的随机数
Description
Ming wants to invite some classmates to participate in a questionnaire survey at school. To ensure the objectivity of the experiment, he first uses a computer to generate N random integers between 1 and 1000 (N ≤ 100). For duplicate numbers, only one is kept, and the rest are removed, as different numbers correspond to different student IDs. Then, these numbers are sorted in ascending order, and Ming approaches classmates in the sorted order to conduct the survey. Please assist Ming in completing the tasks of "deduplication" and "sorting."
Input Format
There are 2 lines of input:
- The first line contains a single positive integer, N, representing the number of random numbers generated.
- The second line contains N positive integers separated by spaces, representing the generated random numbers.
Output Format
There are 2 lines of output:
- The first line contains a single positive integer, M, representing the count of unique random numbers.
- The second line contains M positive integers separated by spaces, representing the deduplicated and sorted random numbers in ascending order.
10
20 40 32 67 40 20 89 300 400 15
8
15 20 32 40 67 89 300 400