Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<queue>
- #include <vector>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- priority_queue<int> pq;
- for(int i = 0; i < n; i++) {
- int a;
- cin >> a;
- pq.push(-a);
- }
- while(!pq.empty()) {
- cout << -pq.top() << " ";
- pq.pop();
- }
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement