5th Test Case is failing.
Hostel Visit Coding problem
I wanted to know, what is wrong with my code. Only 1 testcase if failing
#include<iostream>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
int main() {
long long int q,k,t,x,y;
cin>>q>>k;
typedef tree<long long int , null_type , less<long long int> , rb_tree_tag,
tree_order_statistics_node_update> set;
set s;
while(q-->0)
{
cin>>t;
if(t==1)
{
cin>>x>>y;
s.insert((x*x)+(y*y));
}
else
cout<<*s.find_by_order(k-1)<<endl;
}
return 0;
}
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.
I don’t understand. How my doubt is cleared? You asked me to send code and I did, but you didn’t say what is wrong in my code?