codeforces D. Mishka and Interesting sum 求區間內不同數的異或值
阿新 • • 發佈:2019-02-08
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:
- Two integerslandr(1 ≤ l ≤ r ≤ n) are specified — bounds of query segment.
- Integers, presented in array segment[l, r](in sequence of integersal, al + 1, ..., ar)even number of times, are written down.
-
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
Since only the little bears know the definition of array beauty, all you are to do is to answer each of queries presented.