Submission #292454

#TimeUsernameProblemLanguageResultExecution timeMemory
2924547_7_7Baza (COCI17_baza)C++17
50 / 50
233 ms7988 KiB
#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 timeMemoryGrader output
Fetching results...