If you want to use lower bound or upper bound on vector of pairs then you may thing something of like this
lower_bound(vp.begin(),vp.end(),5);
But this is a wrong syntax as you need to pass a pair in the third argrument.
Now if use want to search from the first value of vector of pairs or use lower bound only on the first element and vice versa so :
In lower bound you may be saerching for the first element not less than the given value the following are the code for using lower bound
In lower bound
upper_bound(vp.begin(),vp.end(),make_pair(4,numeric_limits::max()) );
In upper bound
lower_bound(vp.begin(),vp.end(),make_pair(4,numeric_limits::min()) );
Ans vice versa if you want to use lower bound on the second value
this is my post upvote will be appriciated
can't we use lower bound on vector of pairs of type long long int? it's not working for me.
Here we have to type cast the argruments we send in lower refer to the code below
thanks a lot.
This is his first post guys, please go easy on him. He is just trying to contribute to the community. You are doing good work, keep it up