# 题意

• $2 \le N, M \le 2048$
• $1 \le P \le 64$
• $0 \le A_{ij} \le 65536$

# 思路

STFW看看有没有什么快速算矩阵的方法，没有

# 代码

#include <bits/stdc++.h>
using namespace std;

int n = 0, p = 0, m = 0, bk = 0;
int a[4200][70] = {};
int b[4200][70] = {};
int c[4200][4200] = {};
int apre[4200][10][260] = {};
int bpre[4200][10] = {};
char s[100] = {};

void pre() {
for (int i = 0; i < n; ++i) {
for (int j = 0; j < bk; ++j) {
for (int k = 0; k < 256; ++k) {
for (int p = 0; p < 8; ++p) {
if ((k >> p) & 1) {
apre[i][j][k] += a[i][(j << 3) + p];
}
}
}
}
}
for (int i = 0; i < m; ++i) {
for (int j = 0; j < bk; ++j) {
for (int p = 0; p < 8; ++p) {
bpre[i][j] += b[i][(j << 3) + p] << p;
}
}
}
}

int getAns() {
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
for (int p = 0; p < bk; ++p) {
c[i][j] += apre[i][p][bpre[j][p]];
}
}
}

int ans = 0;
for (int i = 0; i < n; ++i) {
for (int j= 0; j < m; ++j) {
ans ^= c[i][j];
}
}
return ans;
}

int main() {
scanf("%d%d%d", &n, &p, &m), bk = ((p - 1) >> 3) + 1;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < p; ++j) {
scanf("%x", &a[i][j]);
}
}
for (int i = 0; i < m; ++i) {
scanf("%s", s);
for (int j = 0; j < p; ++j) {
b[i][j] = s[j] - '0';
}
}
pre();
printf("%d\n", getAns());
return 0;
}