Can someone suggest some possible approach for this problem..

Правка en1, от shivam_360, 2023-06-17 20:14:25

You are given an array a of length n and q queries... A query is in the form [l,r,x].. First, you need to replace each a[i] with a[i]^x for each i from l to r and then answer for the query will be bitwise OR of all a[i] for each i from l to r... here the changes of each query will permanently reflect in the array...and every time we process on the updated array... constraints: N and q <=10^5 A[i] and x <=10^9 L<=r<=N

suggest some of the possible way to approach this problem and some of intuition for in general solving this type of range update questions.... i think...some kind of segment tree or BIT solution must be there...

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский shivam_360 2023-06-17 20:14:25 704 Initial revision (published)