SHARE
TWEET

Problem-A Хипуй!

kananasgarli90 Jun 6th, 2020 763 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     priority_queue<int>pq;
  6.     int q, a, b;
  7.     cin>>q;
  8.     while(q--){
  9.         cin>>a;
  10.         if(a == 0){
  11.             cin>>b;
  12.             pq.push(b);
  13.         }
  14.         else{
  15.             cout<<pq.top()<<endl;
  16.             pq.pop();
  17.         }
  18.     }
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top