Submission #292454

# Submission time Handle Problem Language Result Execution time Memory
292454 2020-09-07T02:35:25 Z 7_7_7 Baza (COCI17_baza) C++17
50 / 50
233 ms 7988 KB
#include <bits/stdc++.h>

using namespace std;

int n;
int m;
int main()
{
    ios_base::sync_with_stdio(false);

    cin >> n >> m;
    vector<vector<int>> a(n, vector<int>(m));

    for(int i = 0; i < n; i ++){
        for(int j = 0; j < m; j ++){
            cin >> a[i][j];
        }
    }
    int q;
    cin >> q;
    while(q --){
        vector<int> t(m);
        for(auto &x: t) cin >> x;

        int res = 0;
        for(int i = 0; i < n; i ++){
            int good = 1;
            for(int j = 0; j < m; j ++){
                if(t[j] == -1) continue;
                good &= (t[j] == a[i][j]);
            }
            res += good;
        }
        cout << res << "\n";
    }
}

# Verdict Execution time Memory Grader output
1 Correct 46 ms 2680 KB Output is correct
2 Correct 28 ms 1920 KB Output is correct
3 Correct 141 ms 5368 KB Output is correct
4 Correct 23 ms 1596 KB Output is correct
5 Correct 69 ms 4088 KB Output is correct
6 Correct 156 ms 6008 KB Output is correct
7 Correct 233 ms 7988 KB Output is correct
8 Correct 110 ms 5240 KB Output is correct
9 Correct 61 ms 3192 KB Output is correct
10 Correct 186 ms 7676 KB Output is correct