这里下标从 0 开始。
首先考虑两个元素对 ai,aj(i<j),在 (i+1)×(n−j) 个子数组中有贡献,最终我们是将所有异或和都加起来。
我们对于两个数异或值的每个二进制位单独来考虑。
枚举 ai,对于 ai 的第 k 个二进制位,对于答案有贡献,必然是
小美有一个长度为 n 的数组 a 。
By signing up a CodeFun2000 universal account, you can submit code and join discussions in all online judging services provided by us.