Блог пользователя DPUYDV

Автор DPUYDV, история, 16 месяцев назад, По-английски

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.

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
16 месяцев назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

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