Unable to pass Test Cases

I have been attempting the Hostel problem in the Challenges-STL section. I’ve made multiple attempts to solve it using different approaches but each time I’ve not passed a single TC. I downloaded the TC’s to check where I am going wrong but I think the expected output and my output are identical. I’m not sure if there is a printing issue or something but I’m unable to pass any test cases, please do guide.

int32_t main()
{
c_p_c();
int q, k;
cin>>q>>k;
pqb pq1;
rep(i,q){
int a;
cin>>a;
if(a==1){
int x,y;
cin>>x>>y;
int distance = xx + yy;
if(pq1.size()<k)pq1.push(distance);
else{
if(pq1.top()>distance){
pq1.pop();
pq1.push(distance);
}
}
}
else{
cout<<pq1.top()<<’\n’;
}
}
return 0;
}

Share your code using ide.codingblocks.com so that i can debug it for you.

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.