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

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

so i was solving a cses question and i had a confusion...why dont we sort a set or multiset before applying lower bound and upper bound? i saw some solutions and they just simply added the elements and directly applied lower bound and upper bound.

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

»
20 месяцев назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

It's because they are sorted data structures. You might want to read the references for these containers on Cppreference.

  • »
    »
    20 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Sorted data structures = Already sorted right? also why do they have a separate lower bound and upper bound function. why not use the std:lowerbound and upperbound?