Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

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

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

I have heard about segment trees that can handle delete queries by processing the queries offline and creating a segment tree over the timeline of the queries. Does anyone know about this? (It could be persistent segment tree, but i'm not sure. If the structure above does not exist, please tell me.)

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

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

please give the link of the original problem

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

    the editorial uses sqrt decomposition to solve the problem, and i can't just check all submissions, but all submissions i saw used the sqrt method too

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

You need to be more clear about what operations the data structure has to support. If you need it to support the deletion of intervals among many other queries and updates that necessitate a segment tree, then a treap (with merge and split operations) is your best bet.

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

Seams like you are talking about this trick: https://usaco.guide/adv/offline-del?lang=cpp