I am getting one test case wrong. Please tell me what is wrong in my code.
#include
#include
using namespace std;
int main() {
int k,q_type,q;
cin>>q;
cin>>k;
priority_queue<int,vector,greater > pq;
for(int i=k;i>0;iā) {
cin>>q_type;
if(q_type == 1) {
int x,y;
cin>>x>>y;
pq.push(xx + yy);
}
}
q = q - k;
while(qā) {
cin>>q_type;
if(q_type == 1) {
int x,y;
cin>>x>>y;
pq.push(xx + yy);
}
else if(q_type == 2) {
vector v;
for(int i=0;i<k-1;i++) {
v.push_back(pq.top());
pq.pop();
}
cout<<pq.top()<<endl;
for(int i=0;i<v.size();i++) {
pq.push(v.at(i));
}
}
}
return 0;
}