Блог пользователя rick_sanchez_c-137

Автор rick_sanchez_c-137, история, 9 лет назад, По-английски

UPDATE: The problem was found. It was that I should not have used the the generic lower_bound function from algorithm library (I should have used the specific lower_bound from the STL multiset)

Hello!

Regarding this problem, my code (not avaible anymore) implements the same ideia from the following editorial and gets TLE.

Do you know what part of my code is too slow? In my point of view, the code is exacly equal the editorial.

Thanks a lot!

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

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +25 Проголосовать: не нравится

Generalized lower bound doesn't work well on tree data structures.

Use mp.lower_bound(value) and you'll probably get ac :)