| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 (추가 시간 없음) | 1024 MB | 30 | 6 | 6 | 31.579% |
Grammy joined a great party.
There is an interesting game at the party. There are $n$ piles of stones on the table. The $i$-th pile has $a_i$ stones in it. Two players participate in the game and operate the stones in turn.
In each player's turn, the player will do the following two steps:
Those who cannot operate lose the game.
Now, Grammy has $q$ questions. For each question, she asks you how many sub-segments of $[l,r]$ satisfy that if the piles in the segment are taken out alone for the game, the first player will win.
The first line contains two integers $n$ and $q$ (1ドル \leq n, q \leq 10^5$).
The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ (1ドル \leq a_i \leq 10^6$).
The $i$-th of the next $q$ lines contains two integers $l_i$ and $r_i$ (1ドル \leq l_i \leq r_i \leq n$).
The output contains $q$ lines. Each line contains a single integer, denoting the answer to the question.
4 5 1 2 2 4 1 2 2 3 3 4 1 3 2 4
3 2 3 5 5
4 5 5 6 7 8 1 2 2 3 3 4 1 3 2 4
3 3 3 6 6