Codeforces 1113C. Sasha and a Bit of Relax 题解

原题链接:Codeforces 1113C. Sasha and a Bit of Relax
题目大意:给定一个长度为\(n\)的数列\(a_1,a_2,\cdots,a_n\),然后,求数列中有多少个满足一下性质的\([l,r]\)

  1. \(r-l+1\)是偶数
  2. \(mid=\frac{r-l+1}{2}\),则有\(a_1\oplus a_2\oplus \cdots \oplus a_{mid}=a_{mid+1}\oplus a_{mid+2}\oplus \cdots\oplus a_r\)
    (注:\(\oplus\)在C++中就是异或的意思,也就是^)

题解:我们知道,对于\(oplus\)操作,我们是可以用前缀和的,那么,

猜你喜欢

转载自www.cnblogs.com/withhope/p/10392012.html
今日推荐