Submission #143976

#TimeUsernameProblemLanguageResultExecution timeMemory
14397644442Baza (COCI17_baza)C++11
50 / 50
272 ms9464 KiB
#include <bits/stdc++.h> using namespace std; int n,m,q,a[1004][1004],b[60][1004],ok,v[60][1004]; 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>>a[i][j]; } } cin>>q; for(int d=0;d<q;d++){ for(int j=0;j<m;j++){ cin>>b[d][j]; } } for(int d=0;d<q;d++){ ok=0; for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ if(b[d][j]!=-1){ if(!v[d][i] and a[i][j]!=b[d][j]) v[d][i]=1; } } if(!v[d][i]) ok++; } cout<<ok<<endl; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...