# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
97894 | AKaan37 | Baza (COCI17_baza) | C++14 | 171 ms | 13088 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;
typedef long long int lo;
typedef pair< int,int > PII;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(lo i=1;i<=n;i++)
const int inf = 1000000000;
const int mod = 1000000007;
const int KOK = 100000;
const int li = 100005;
const int LOG = 20;
lo n,m,cev,x,k,b[li],a[1005][1005];
vector<int> v;
char c;
string s;
int main(){
scanf("%lld %lld",&n,&m);
FOR{
for(lo j=1;j<=m;j++){
scanf("%lld",&a[i][j]);
}
}
lo t=0;
scanf("%lld",&t);
while(t--){
cev=0;
for(lo i=1;i<=m;i++){
scanf("%d",&b[i]);
}
for(lo i=1;i<=n;i++){
lo flag=0;
for(lo j=1;j<=m;j++){
if(a[i][j]!=b[j] && b[j]!=-1) flag=1;
}
if(flag==0) cev++;
}
printf("%lld\n",cev);
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |