# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
465294 | rainboy | Baza (COCI17_baza) | C11 | 120 ms | 8932 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.
#include <stdio.h>
#define N 1000
#define M 1000
int main() {
static int aa[N][M], bb[M];
int n, m, q, i, j;
scanf("%d%d", &n, &m);
for (i = 0; i < n; i++)
for (j = 0; j < m; j++)
scanf("%d", &aa[i][j]);
scanf("%d", &q);
while (q--) {
int cnt;
for (j = 0; j < m; j++)
scanf("%d", &bb[j]);
cnt = 0;
for (i = 0; i < n; i++) {
int match = 1;
for (j = 0; j < m; j++)
if (bb[j] != -1 && aa[i][j] != bb[j]) {
match = 0;
break;
}
if (match)
cnt++;
}
printf("%d\n", cnt);
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |