Question about queries?

Revision en1, by MODDI, 2023-12-11 01:25:12

Let's say we have an array of size N(N <= 100000) and Q queries (Q <= 100000), where each query is either:

  • Add(l, r, x), add x to every element between l and r
  • Query(l, r) — number of elements that are zero between l and r

Each add operation is performed under a certain (fixed) modulo m. Any ideas on how this can be done?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English MODDI 2023-12-11 01:25:12 372 Initial revision (published)