#include <bits/stdc++.h>
using namespace std;
int main() {
priority_queue<int> pq;
pq.push(1);
pq.push(5);
pq.push(2);
pq.push(6);
cout << pq.top(); // print 6
cout << endl;
pq.pop();
cout << pq.top(); // print 5
cout << endl;
priority_queue<pair<int,int>> pq2;
pq2.push({1, 5});
pq2.push({1, 6});
pq2.push({1, 7});
cout << pq2.top().first << " " << pq2.top().second << endl;
priority_queue<int, vector<int>, greater<int>> pq3; // min pq
pq3.push(1);
pq3.push(5);
pq3.push(2);
pq3.push(6);
cout << pq3.top() << endl; // prints 1
priority_queue<pair<int,int>, vector<pair<int,int>>, greater<pair<int,int>>> pq4;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCQoJcHJpb3JpdHlfcXVldWU8aW50PiBwcTsKCXBxLnB1c2goMSk7IAoJcHEucHVzaCg1KTsgCglwcS5wdXNoKDIpOyAKCXBxLnB1c2goNik7IAogCgljb3V0IDw8IHBxLnRvcCgpOyAvLyBwcmludCA2IAoJY291dCA8PCBlbmRsOwoJcHEucG9wKCk7IAoJY291dCA8PCBwcS50b3AoKTsgLy8gcHJpbnQgNSAKCWNvdXQgPDwgZW5kbDsKIAoJcHJpb3JpdHlfcXVldWU8cGFpcjxpbnQsaW50Pj4gcHEyOwoJcHEyLnB1c2goezEsIDV9KTsgCglwcTIucHVzaCh7MSwgNn0pOyAKCXBxMi5wdXNoKHsxLCA3fSk7IAoJY291dCA8PCBwcTIudG9wKCkuZmlyc3QgPDwgIiAiIDw8IHBxMi50b3AoKS5zZWNvbmQgPDwgZW5kbDsKCQoJcHJpb3JpdHlfcXVldWU8aW50LCB2ZWN0b3I8aW50PiwgZ3JlYXRlcjxpbnQ+PiBwcTM7IC8vIG1pbiBwcQoJcHEzLnB1c2goMSk7IAoJcHEzLnB1c2goNSk7IAoJcHEzLnB1c2goMik7IAoJcHEzLnB1c2goNik7IAogCgljb3V0IDw8IHBxMy50b3AoKSA8PCBlbmRsOyAvLyBwcmludHMgMSAKIAoJcHJpb3JpdHlfcXVldWU8cGFpcjxpbnQsaW50PiwgdmVjdG9yPHBhaXI8aW50LGludD4+LCBncmVhdGVyPHBhaXI8aW50LGludD4+PiBwcTQ7CgkKCXJldHVybiAwOwp9Cg==