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

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

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
  • Проголосовать: не нравится

»
17 месяцев назад, # |
  Проголосовать: нравится +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

  • »
    »
    17 месяцев назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится
    **ordered_set with less_equals doesn't 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 ??