#include <queue> #include <iostream> #include <cstdio> #include <cctype> using namespace std; typedef long long ll; priority_queue< ll , vector < ll > , greater < ll > >q; //greater 从小到大排序 //less 从大到小排序 inline ll read () { ll x=0,f=1; char ch=getchar(); while(!isdigit(ch)) { if(ch=='-') f=-1; ch=getchar(); } while(isdigit(ch)) { x=(x<<1)+(x<<3)+(ch^48); ch=getchar(); } return x*f; } int n; signed main() { n=read(); for(register int i=1; i<=n; i++) q.push(read()); while(!q.empty()){ cout<<q.top()<<' '; q.pop(); } return 0; //q.empty() 判断队列是否是空的 //q.clear() 清空队列 //q.push(x) 把x放到队尾 //q.top() q的第一个元素 //q.pop() q的第一个元素出队 }