2d range update & range queries with compressed memory?

Правка en3, от SkyMagic, 2025-01-31 18:05:27

Here's a question, is it possible to implement a data structures that supports these operations online:

  • 2d Range update(only the add operation, no negative number for adding)
  • 2d Range queries(get the sum)
  • use Low memory(possibly $$$O(nlogn)$$$)

Here are the constraints:

  • $$$n \leq 10^5$$$
  • $$$q \leq 10^5$$$

I think a fenwick tree could work but I'm not sure if it will TLE or not.

If anyone could verify that using a fenwick tree could work please let me know. Thanks in advance!

Теги question, data structures, 2d, range update

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский SkyMagic 2025-01-31 18:05:27 11 Tiny change: 'operations:\n\n - 2d' -> 'operations **online**:\n\n - 2d'
en2 Английский SkyMagic 2025-01-31 16:37:13 0 (published)
en1 Английский SkyMagic 2025-01-31 16:36:58 582 Initial revision (saved to drafts)