Advertisement
LEGEND2004

priority_queue

Oct 1st, 2023
708
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. //#define int long long
  5. const int INF = 1e18;
  6. const int N = 1e3 + 5;
  7. const int mod = 1e9 + 7;
  8.  
  9.  
  10. signed main()
  11. {
  12.     priority_queue<int , vector<int> , greater<int> > q;
  13.     q.push(1);
  14.     q.push(9);
  15.     q.push(5);
  16.     q.push(5);
  17.     q.push(7);
  18.     while(!q.empty()){
  19.         cout << q.top() << endl;
  20.         q.pop();
  21.     }
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement