# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
66353 | KLPP | Baza (COCI17_baza) | C++14 | 144 ms | 32972 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<iostream>
#include<vector>
#include<queue>
#include<algorithm>
#include<stdio.h>
using namespace std;
int n,m;
int arr[10000][10000];
int main(){
scanf("%d %d",&n,&m);
for(int i=0;i<n;i++){
for(int j=0;j<m;j++)scanf("%d",&arr[i][j]);
}
int q;
scanf("%d",&q);
while(q--){
bool b[n];
for(int i=0;i<n;i++)b[i]=true;
for(int j=0;j<m;j++){
int x;
scanf("%d",&x);
if(x!=-1){
for(int i=0;i<n;i++){
if(arr[i][j]!=x)b[i]=false;
}
}
}
int ans=0;
for(int i=0;i<n;i++)ans+=b[i];
printf("%d\n",ans);
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |