How can I solve this problem.

Revision en1, by code_hard123, 2016-08-22 22:59:15

Given an array, and there are Q queries of two types.

Type-1 : given l , r , val

Update a[i] = a[i] xor val where i = [l , r]

Type-2 : given l , r

Return sum of a[i] where i = [l , r]

Can it be solved with segment tree with lazy propagation?

ThankYou :)

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English code_hard123 2016-08-22 23:01:46 6 Tiny change: 'be solved with segment t' -> 'be solved by segment t'
en1 English code_hard123 2016-08-22 22:59:15 301 Initial revision (published)