467B codeforces
Fedor and new game
Solution in c++
#include <iostream>
using namespace std;
int main()
{
int n,m,k,sol,solv=0,tr;
cin>>n>>m>>k;
int nn[m+1];
for(int o=0;o<=m;o++)cin>>nn[o];
int trr=nn[m];
for(int o=0;o<m;o++){
int trrr=nn[o];
sol=0;
for(int i=31;i>=0;i--){
int p1=0;
if(trrr&(1<<i)){p1++;}
if(trr&(1<<i)){p1++;}
if(p1==1)sol++;
}
if(sol<=k)solv++;
}
cout<<solv<<"\n";
return 0;
}
0 التعليقات:
إرسال تعليق