排序
#include<iostream>
#include<algorithm>
using namespace std;
const int N = 1005;
int arr[N],num[N];
int main () {
int n,i = 0,temp;
cin >> n;
for (int j = 1;j <= n;j++) {
cin >> temp;
if (num[temp] == 0) {
num[temp]++;
arr[i++] = temp;
}
}
sort(arr,arr + i);
cout << i << endl;
for (int j = 0;j < i;j++) {
cout << arr[j] << ' ';
}
return 0;
}