O(n³) Stress Test Matrix Multiplication
Points 100 8.0s 256MYou are given two \(n \times n\) matrices \(A\) and \(B\). Compute the bitwise xor of all entries in the product \(A \times B\).
Input
The first line contains a positive integer \(n\) (\(n \le 1200\)).
Each of the next \(n\) lines describes a row of matrix \(A\) as a string of length \(n\) consisting of digits 0 through 7; the digit in row \(i\), column \(j\) gives \(A_{i,j}\). The following \(n\) lines, in the same format, describe matrix \(B\).
Output
Output the xor of all elements of \(A \times B\).
Sample Input 1
2
76
05
56
46
Sample Output 1
127
Log in to write and submit code.
Log in