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

Автор kllp, 10 лет назад, По-английски

M is an n*n matrix. Is it possible to code a data structure that supports these operations:

  • addValue(x1, x2, y1, y2, a): Adds a to every element M[y1...y2][x1...x2]. Should work in O(log^2 n).
  • getMin(x1, x2, y1, y2): Returns minimum from elements M[y1...y2][x1...x2]. Should work in O(log^2 n).

I tried to solve this with 2d segment tree but nothing works because of the min QAQ

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

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

Treap of Segment trees :)

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

What does QAQ mean?