Sample test case is passed, but still giving wrong output

#include<bits/stdc++.h>
using namespace std;

typedef long long LL;

LL getRocketDistance(int x, int y){

     return (x*x) + (LL)(y*y);

}

int main(){

priority_queue<LL> pq;
priority_queue<LL,vector<LL>,greater<LL>> pendingEntries;
int n,k;
cin >> n >> k;
for(int i = 0; i < n; i++){
    int type;
    cin >> type;
    if(type == 1){
        int x,y;
        cin >> x >> y;
        LL rocketDistance = getRocketDistance(x,y);
        if(pq.size() < k){
            pq.push(rocketDistance);
        }else{
            LL currentMax = pq.top();
            if(currentMax > rocketDistance){
                pq.pop();
                pq.push(rocketDistance);
                pendingEntries.push(currentMax);
            }else{
                pendingEntries.push(rocketDistance);
            }
        }
    }else{
        cout << pq.top() << endl;
        pq.pop();
    }
}
return 0;

}

this is the solution to hostelVisit problem and its not getting submitted, can anyone help me find the mistake, i have took 2 priority queue one is max and other is min

@mehul.narendra.dubey hey you just neeed to take 1 max priority queue, and maintain its size as k always, whenever you encounter a hostel whose distance is smaller than the top of priority queue, pop from queue and push this new distance. When ever you get the query for printing the kth hostel just print the top of queue
If this resolves your answer marked it as resolved.