Hostel visit problem STL

what’s wrong with this code?

#include
#include
using namespace std;

int main() {
priority_queue<long long, vector, greater >pq;
int n,k;
cin>>n>>k;
while(n–){
int no;
cin>>no;
if(no == 1){
long long x, y;
cin>>x>>y;
pq.push(xx + yy);
}
else{
long long a[3];
for(int i = 0; i<2; i++){
a[i] = pq.top();
pq.pop();
}
a[2] = pq.top();
cout<<pq.top()<<endl;
pq.push(a[0]);
pq.push(a[1]);

	}
}

return 0;

}

hi @Username_cb use a max heap for this question

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.