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[]; int main(){
int n, m, k;
int ans, ret=;
scanf("%d%d%d", &n, &m, &k);
for(int i=; i<=m; ++i)
scanf("%d", &a[i]);
scanf("%d", &ans);
for(int i=; i<=m; ++i){
int tmp = ans^a[i], cnt=;
while(tmp){
if(tmp&) ++cnt;
tmp>>=;
}
if(cnt<=k) ++ret;
}
printf("%d\n", ret);
return ;
}
codeforces Fedor and New Game的更多相关文章
- codeforces 467B Fedor and New Game 解题报告
题目链接:http://codeforces.com/contest/467/problem/B 题目意思:有 m + 1 个 player 和 n 种类型的 soldiers.每个player被赋予 ...
- 【codeforces 754D】Fedor and coupons
time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...
- codeforces 754D. Fedor and coupons
D. Fedor and coupons time limit per test 4 seconds memory limit per test 256 megabytes input standar ...
- Codeforces 390Div2-754D. Fedor and coupons(贪心+优先队列)
D. Fedor and coupons time limit per test 4 seconds memory limit per test 256 megabytes input standar ...
- 【Codeforces 467D】Fedor and Essay
Codeforces 467 D 题意:给\(m\)个单词,以及\(n\)个置换关系,问将\(m\)个单词替换多次后其中所含的最少的\(R\)的数量以及满足这个数量的最短总长度 思路:首先将置 ...
- Codeforces Round #267 (Div. 2) D. Fedor and Essay tarjan缩点
D. Fedor and Essay time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
- Codeforces Round #390 (Div. 2) D. Fedor and coupons(区间最大交集+优先队列)
http://codeforces.com/contest/754/problem/D 题意: 给定几组区间,找k组区间,使得它们的公共交集最大. 思路: 在k组区间中,它们的公共交集=k组区间中右端 ...
- Codeforces Round #267 (Div. 2) B. Fedor and New Game【位运算/给你m+1个数让你判断所给数的二进制形式与第m+1个数不相同的位数是不是小于等于k,是的话就累计起来】
After you had helped George and Alex to move in the dorm, they went to help their friend Fedor play ...
- CodeForces 467D(267Div2-D)Fedor and Essay (排序+dfs)
D. Fedor and Essay time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
随机推荐
- hive函数 -- split 字符串分割函数
hive字符串分割函数 split(str, regex) - Splits str around occurances that match regexTime taken: 0.769 secon ...
- easyui tree 编辑后保留原先状态
$(function () { var selected = $('#depttree').tree('getSelected'); $('#depttree').tree({ checkbox: f ...
- 一个简单的JavaScript Map
用js写了一个Map,带遍历功能,请大家点评下啦. //map.js Array.prototype.remove = function(s) { for (var i = 0; i < thi ...
- js 去掉字符串前面的0
<script>var a='00123';alert(a.replace(/\b(0+)/gi,""));</script>
- [界面开发新秀]AYUI开发360领航版系列教程-AyWindow接入[1/40]
开发包DLL下载地址:请加入 466717219群,自己下载(已经发布ayui3.7,在群里,为了不让你作为收藏工具,也只有入群才能下载,喜欢你就进.不喜欢你还是不要来了) AYUI初衷:简单化商业软 ...
- webService发布和调用--Axis2
一.工具 1.下载 Axis2以及eclipse的Axis2插件.http://axis.apache.org/axis2/java/core/download.cgi 2.axis2-1.7.1-w ...
- Maven Learning - Direct Dependencies & Transitive Dependencies
Dependencies declared in your project's pom.xml file often have their own dependencies. The main dep ...
- int跟byte[]数组互转的方法,整数 + 浮点型
整数: int转byte数组 public static byte[] intToBytes2(int n){ ]; ;i < ;i++) { b[i]=(-i*)); } return b; ...
- Navi.Soft30.开放平台.百度.开发手册
1系统简介 1.1功能简述 现在是一个信息时代,并且正在高速发展.以前获取信息的途径非常少,可能只有电视台,收音机等有限的来源,而现在的途径数不胜数,如:QQ,微信,官方网站,个人网站等等 本开发手册 ...
- 利用 a 标签自动解析 url
很多时候,我们有从 url 中提取域名,查询关键字,变量参数值等的需求,然而我们可以让浏览器方便地帮助我们完成这一任务而不用写正则去抓取.方法就是先创建一个 a 标签然后将需要解析的 url 赋值给 ...