codeforces Fedor and New Game

简介:

#include<iostream>
#include<stack>
#include<cstring>
#include<cstdio>
#include<queue>
#include<vector>
#include<algorithm>
#define INF 0x3f3f3f3f
using namespace std;

int a[1005];

int main(){
    int n, m, k;
    int ans, ret=0;
    scanf("%d%d%d", &n, &m, &k);
    for(int i=1; i<=m; ++i)
        scanf("%d", &a[i]);
    scanf("%d", &ans);
    for(int i=1; i<=m; ++i){
        int tmp = ans^a[i], cnt=0;
        while(tmp){
            if(tmp&1) ++cnt;
            tmp>>=1;
        }
        if(cnt<=k)  ++ret;
    } 
    printf("%d\n", ret);
    return 0;
}

目录
相关文章
codeforces 302 B. Eugeny and Play List
题目链接 有n首歌,编号从1到n,每首歌播放时间为t,播放次数为c,n首歌按次序播放,有m个询问,输出第v分钟正在播放的歌曲编号。 很简单的二分查找,直接贴代码。
53 0
|
Python
python实现简单的snake game!
python实现简单的snake game!
120 0
codeforces327——A. Flipping Game(前缀和)
codeforces327——A. Flipping Game(前缀和)
97 0
|
人工智能
Codeforces 839B Game of the Rows【贪心】
B. Game of the Rows time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output...
1168 0
|
机器学习/深度学习
数学 - Codeforces Round #319 (Div. 1)A. Vasya and Petya&#39;s Game
Vasya and Petya's Game  Problem's Link   Mean:  给定一个n,系统随机选定了一个数x,(1
1003 0

热门文章

最新文章