# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
249485 | VEGAnn | Baza (COCI17_baza) | C++14 | 115 ms | 4216 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;
const int N = 1010;
int a[N][N], n, m, b[N];
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef _LOCAL
freopen("in.txt","r",stdin);
#endif // _LOCAL
cin >> n >> m;
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
cin >> a[i][j];
int qq; cin >> qq;
for (; qq; qq--){
for (int i = 0; i < m; i++)
cin >> b[i];
int ans = 0;
for (int i = 0; i < n; i++){
bool ok = 1;
for (int j = 0; j < m && ok; j++)
if (b[j] > 0 && b[j] != a[i][j])
ok = 0;
ans += ok;
}
cout << ans << '\n';
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |