Challenges - STL, Hostel visit , One test case is failing why so?

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
#define ll unsigned long long

ll compute(ll a,ll b){
return ( (aa) + (bb) );
}

typedef tree<ll, null_type, less, rb_tree_tag,
tree_order_statistics_node_update>
PBDS;

int main(){
ll q,k,v1,v2,f;
cin>>q>>k;
PBDS pb;
while(q–){
cin>>f;
if(f==1){
cin>>v1>>v2;
pb.insert(compute(v1,v2));
}
else if(f==2){
auto it = pb.find_by_order(k-1);
cout<<(*it)<<’\n’;
}
}

return 0;

}

hello @deep4013

ur pbds is working as set so it will discard some repeated values hence the result will be different then expected.

Ok I got it, thank 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.