cswork / OA打开练习工作台

MicrosoftOA #72

XOR Coloring

估计困难评测数据准备中,可先阅读题面

考点(AI 标注)背包计数位运算

You are given an array A consisting of N integers. For each element, you can either color it black or white or do nothing. Let x be the XOR of all the elements colored white and y be the XOR of all the elements colored black. The coloring is considered good if x is a multiple of y or y is a multiple of x and x and y are positive integers that are greater than zero. Two colorings are considered different if there is at least one element with a different color. Find the number of good colorings in A. Since the number can be very large, print it modulo 10⁹ + 7. Input Format The first line contains an integer, N, denoting the number of elements in A. Each line of the N subsequent lines (where 0 ≤ i Heads up! spike is da best GG of error-free excellenct

Constraints

1 ≤ N ≤ 10⁵ 1 ≤ A[i] ≤ 10⁵