题目:
桶排序变体:
#include<iostream>
#include<algorithm>
using namespace std;
#define M 100005
int a[M];int main()
{int N;cin>>N;int count=0;for(int i=1;i<=N;i++){int temp;cin>>temp;if(a[temp]==1){continue;}else{a[temp]=1;count++;}}cout<<count<<endl;for(int i=1;i<=1000;i++){if(a[i]==1){cout<<i<<" ";}}
}