A problem on array bitwise-OR sums

Revision en1, by piggy123, 2025-03-28 05:32:42

We have an array of integers $$$a_{1...n}$$$, and we have $$$q$$$ updates where we change one of the elements of it. After each update, we need to output the bitwise-OR sum of the entire array. Could this be done(offline) in linear time?

Consider the bitwise operations on integers to be $$$O(1)$$$.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English piggy123 2025-03-28 05:32:42 324 Initial revision (published)