学提高学的累死个人,切个水题开心一下
#include<bits/stdc++.h>
using namespace std;
int st[105],top;
int main()
{
int n,x,temp;
priority_queue<int> q;
cin>>n;
temp=n;
while(n--)
{
cin>>x;
q.push(x);
}
while(!q.empty())
{
int y=q.top();
q.pop();
if(y!=st[top])st[++top]=y;
else temp--;
}
cout<<temp<<endl;
while(top)
{
cout<<st[top--]<<" ";
}
return 0;
}