XOR Operations
시간 제한2초메모리 제한1024 MB
정수 a_i가 주어질 때, b_i와 b_j에 a_i xor a_j를 XOR하는 연산을 반복해 만들 수 있는 서로 다른 수열 B의 가짓수를 998244353으로 나눈 나머지를 구한다.
문제
You are given integers . You have a sequence of integers which initially are all zeroes.
In one operation, you choose two different indices and , then simultaneously
- replace with , and
- replace with .
Note that represents the bitwise XOR operation, which returns an integer whose binary representation has a in each bit position for which the corresponding bits of either but not both operands are . For example, because .
You want to compute the number of different possible sequences you can obtain after performing zero or more operations. Since this number might be huge, calculate this number modulo .
Two sequences of length are considered different if and only if there exists an index () such that the -th element of one sequence differs from the -th element of the other sequence.
입력
The first line of input contains one integer (). The second line contains integers ( for all ).
출력
Output an integer representing the number of different possible sequences you can obtain after performing zero or more operations modulo .