not getting corect answer but in codeblocks its showing right
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
class hostel{
public:
int x,y;
hostel(ll x,ll y){
this->x=x;
this->y=y;
}
ll dist(){
return (x*x + y*y);}
};
class mycompare{
public:
bool operator()(hostel a,hostel b){
return a.dist()< b.dist();}
};
int main(){
ll q,k;
cin>>q>>k;
ll a,x,y;
priority_queue<hostel,vector,mycompare > pq;
int cs=0;
while(q–){
cin>>a;
if(a==1){
cin>>x>>y;
if(pq.size()!=k){
hostel h(x,y);
pq.push(h);
cs++;}
else{
hostel h(x,y) ,h1=pq.top();
ll t=h.dist();
ll r=h1.dist();
if(t<r){
pq.pop();
pq.push(h);
}
}
}
else if(a==2){
hostel h=pq.top();
cout<<h.dist();
}
}
}