链接:https://ac.nowcoder.com/acm/contest/33192/K
来源:牛客网
Grammy joined a great party.
There is an interesting game at the party. There are
nnn piles of stones on the table. The
iii-th pile has
aia_iai stones in it. Two pla
yers participate in the game and operate the stones in turn.
In each player's turn, the player will do the following two steps:
-
Select a non-empty pile of stones, select a positive amount of stones to remove from it.
-
Keep the remaining stones in the pile still or merge them all into another non-empty pile of stones.
Those who cannot operate lose the game.
Now, Grammy has qqq questions. For each question, she asks you how many sub-segments of [l,r][l,r][l,r] satisfy that if the piles in the segment are taken out alone for the game, the first player will win.