# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
94922 | MohamedAhmed0 | Baza (COCI17_baza) | C++14 | 97 ms | 7928 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 <bits/stdc++.h>
using namespace std;
int main()
{
int n , m ;
scanf("%d %d" , &n , &m);
int arr[n][m] , arr2[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--)
{
for(int i = 0 ; i < m ; ++i)
scanf("%d" , &arr2[i]);
int ans = 0 ;
for(int i = 0 ; i < n ; ++i)
{
bool t = true ;
for(int j = 0 ; j < m ; ++j)
{
if(!t)
break;
if(arr[i][j] != arr2[j] && arr2[j] != -1)
t = false ;
}
if(t)
ans++;
}
printf("%d\n" , ans);
}
return 0 ;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |