Advertisement
Josif_tepe

Untitled

Mar 14th, 2021
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <queue>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     ios_base::sync_with_stdio(false);
  9.     priority_queue<int> pq;
  10.     pq.push(2);
  11.     pq.push(1);
  12.     pq.push(5);
  13.     pq.push(3);
  14.     pq.push(10);
  15.     pq.push(4);
  16.    
  17.     while(!pq.empty()) {
  18.         cout << pq.top() << endl;
  19.         pq.pop();
  20.     }
  21.     return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement