DPUYDV's blog

By DPUYDV, history, 3 years ago, In English

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.

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
3 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

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