#542. 「Nowcoder多校 2019 Day1」Parity of Tuples
「Nowcoder多校 2019 Day1」Parity of Tuples
题目描述
Bobo has n m-tuple , where . He wants to find which is the number of where has odd number of ones in its binary notation for all j. Note that denotes the bitwise-and.
Print $ \bigoplus_{x = 0}^{2^k - 1} \left(\mathrm{count}(x) \cdot 3^x \bmod (10^9+7)\right) $ for given k, where denotes bitwise-xor.
输入格式
The input consists of several test cases and is terminated by end-of-file.
The first line of each test case contains three integers n, m and k. The ith of the following n lines contains m integers .
- .
- There is exactly one test case with , m = 10 and k = 20. The other 300 test cases have , and .
输出格式
For each test case, print an integer which denotes the result.
样例
样例输入
1 2 2
3 3
1 2 2
1 3
3 3 4
1 2 3
4 5 6
7 8 9
样例输出
10
3
1102106