problem
solution
codes
#include<iostream>
using namespace std;
int n, a[1010], t;
int main(){
cin>>n;
for(int i = 1; i <= n; i++){
int x; cin>>x;
if(!a[x]){ a[x]++; t++; }
}
cout<<t<<"\n";
for(int i = 1; i <= 1000; i++)
if(a[i])cout<<i<<" ";
return 0;
}