I was solving problem Buying gifts. I am getting wrong answer if I use ordered_multiset(pbds) submission link. If I use std::multiset instead of ordered_multiset than solution gets accepted submission link. Can somebody explain why and what am I doing wrong???
Note : Sorry for my bad English.
ordered set with less_equals doesnt work well, it's not meant to be used like this. If you want it to act like a multiset with the special order functions, then use it with pair<int,int> where the first value is the number and the second is a unique index, and then a normal less<> comparator will work well
means is this any internal problem of pbds? can you provide any link of documentation or tutorial or more deep understanding.
I am still confused why this happens ??
https://mirror.codeforces.com/blog/entry/88193 Partially answered here. The thing is that it uses a general template for a balanced tree so using less_eqial messes up the ordering