#267B. Fedor and New Game-----每日两道水(1)
来源:互联网 发布:现货分时指标公式源码 编辑:程序博客网 时间:2024/05/19 13:14
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<vector>
#include<cmath>
#include<stdlib.h>
#include<iomanip>
#include<list>
#include<deque>
#include<map>
#include <stdio.h>
#include <queue>
#define maxn 10000+5
#define ull unsigned long long
#define ll long long
#define reP(i,n) for(i=1;i<=n;i++)
#define rep(i,n) for(i=0;i<n;i++)
#define cle(a) memset(a,0,sizeof(a))
#define mod 90001
#define PI 3.141592657
#define INF 1<<30
const ull inf = 1LL << 61;
const double eps=1e-5;
using namespace std;
bool cmp(int a,int b){
return a>b;
}
char s[1005][22];
void change(int i,int d,char s[][22])
{
for(int q=0;q<22;q++)
s[i][q]='0';
int b,j=0;
while(1)
{
b=d%2;
s[i][j]=b+'0';
d=d/2;
if(d==0)break;
j++;
}
}
int main()
{
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
int n,m,k,d,cnt;
cin>>n>>m>>k;
cnt=0;
for(int i=0;i<=m;i++)
{
cin>>d;
change(i,d,s);
}
int ans=0;
for(int i=0;i<m;i++)
{
cnt=0;
for(int j=0;j<n;j++)
{
if(s[i][j]!=s[m][j])cnt++;
}
if(cnt<=k)
ans++;
}
cout<<ans<<endl;
return 0;
}
- #267B. Fedor and New Game-----每日两道水(1)
- CF 267B Fedor and New Game
- B. Fedor and New Game
- Codeforces Round #267 (Div. 2) B. Fedor and New Game
- Codeforces Round #267 (Div. 2) B. Fedor and New Game
- Codeforces 467B Fedor and New Game
- 【CODEFORCES】 B. Fedor and New Game
- cf-467B. Fedor and New Game
- Codeforces 467B Fedor and New Game
- Codeforces Round #267 (Div. 2) B. Fedor and New Game(位运算)
- 二进制新知识(Codeforces Round #267 (Div. 2) B. Fedor and New Game)
- Fedor and New Game
- Codeforces 467B Fedor and New Game(暴力)
- cf467B Fedor and New Game
- codeforces—— 467B —— Fedor and New Game
- codeforces754D Fedor and coupons
- cf 267 div.2 D Fedor and Essay
- Codeforces Round #267 (Div. 2) D. Fedor and Essay
- HDU4802 GPA
- HDU 5059 help him
- ACM牡丹江区域赛
- 英语演讲
- HDU1241 Oil Deposits
- #267B. Fedor and New Game-----每日两道水(1)
- HDU 1181 变形课
- Centos6.7 安装Sublime text 3
- CF 261A. Pashmak and Garden
- #274B. Towers
- #274A. Expression
- 文件加密
- #261B. Pashmak and Flowers
- UVa100 The 3n + 1 problem