# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
61644 | win11905 | Baza (COCI17_baza) | C++11 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
const int N = 1e3+5;
int n, m, q, ret[N], A[N][N];
int main() {
scanf("%d %d", &n, &m);
for(int i = 1; i <= n; ++i) for(int j = 1; j <= m; ++j) scanf("%d", A[i]+j);
scanf("%d", &q);
for(int i = 0; i < q; ++i) {
for(int j = 1; j <= m; ++j) scanf("%d", ret+j);
int sum = 0;
for(int i = 1; i <= n; ++i) {
bool st = true;
for(int j = 1; j <= m; ++j) {
if(ret[j] == -1) continue;
if(A[i][j] != ret[j]) st = false;
}
sum += st;
}
printf("%d\n", sum);
}
}