Submission #117299

#TimeUsernameProblemLanguageResultExecution timeMemory
117299MatesV13Baza (COCI17_baza)C++11
50 / 50
98 ms9052 KiB
#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 timeMemoryGrader output
Fetching results...