1. 程式人生 > >codeforces D. Mishka and Interesting sum 求區間內不同數的異或值

codeforces D. Mishka and Interesting sum 求區間內不同數的異或值

Little Mishka enjoys programming. Since her birthday has just passed, her friends decided to present her with array of non-negative integersa1, a2, ..., anofnelements!

Mishka loved the array and she instantly decided to determine its beauty value, but she is too little and can't process large arrays. Right because of that she invited you to visit her and asked you to processm

queries.

Each query is processed in the following way:

  1. Two integerslandr(1 ≤ l ≤ r ≤ n) are specified — bounds of query segment.
  2. Integers, presented in array segment[l,  r](in sequence of integersal, al + 1, ..., ar)even number of times, are written down.
  3. XOR-sum of written down integers is calculated, and this value is the answer for a query. Formally, if integers written down in point 2 arex
    1, x2, ..., xk
    , then Mishka wants to know the value, where — operator of exclusive bitwise OR.

Since only the little bears know the definition of array beauty, all you are to do is to answer each of queries presented.