STL quiz 1 question

#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pi;
struct Compare
{
bool operator()(pi const & a, pi const & b)
{
if(a.second < b.second)
{
return true;
}
else if(a.second > b.second)
{
return false;
}
else
{
if(a.first > b.first)
{
return true;
}
return false;
}
}
};
int main()
{
priority_queue<pi , vector, Compare>q;
q.push({1, 5});
q.push({5, 15});
q.push({7, 15});
q.push({10, 2});
q.push({1, 10});
cout<<q.top().first<<" "<<q.top().second<<endl;
return 0;
}
I don’t get how to debug this?

STL quiz 1 question no 11

priority_queue<pi , vector, Compare>q;
Check if its right or wrong please

sir i know this ,i actually have doubt in stl quiz 1 q.no 11,

I don’t get how o/p of that question come

You just need to dry run the code on pen and paper. There’s nothing else in the question.
Try harder.