# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
117299 | MatesV13 | Baza (COCI17_baza) | C++11 | 98 ms | 9052 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 it[1005][1005];
int ok[1005];
int m,n,q, d;
int main (){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin >> n >> m;
for (int i=0;i<n;i++){
for (int j=0;j<m;j++){
cin >> it[i][j];
}
}
cin >> q;
for (int nj=0;nj<q;nj++){
for (int i=0;i<n;i++) ok[i]=1;
for (int i=0;i<m;i++){
cin >> d;
if (d==-1) continue;
for (int j=0;j<n;j++){
if (it[j][i]!=d) ok[j]=0;
}
}
int ans=0;
for (int i=0;i<n;i++) ans+=ok[i];
cout << ans << endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |