# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
79956 | pzdba | Baza (COCI17_baza) | C++14 | 155 ms | 30408 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 <bits/stdc++.h>
using namespace std;
int a[1005][1005];
int b[1005];
int main(){
int n, m;
scanf("%d%d", &n, &m);
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++) scanf("%d", &a[i][j]);
}
int q;
scanf("%d", &q);
for(int i=1;i<=q;i++){
for(int j=1;j<=m;j++) scanf("%d", &b[j]);
int ans = 0;
for(int i=1;i<=n;i++){
bool ok = 1;
for(int j=1;j<=m;j++){
if(b[j] == a[i][j] || b[j] == -1) continue;
ok = 0;
}
ans += ok;
}
printf("%d\n", ans);
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |