priority_queue<int,vector<int>,greater<int>> d;
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
priority_queue<int,vector<int>,greater<int>> d;
for(int i=0;i<n;i++){
int x;
cin>>x;
d.push(x);
}
while(n--){
cout<<d.top()<<" ";
d.pop();
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发