题面在这里

拆位分析一下就OK啦

/*
y + (y xor x)
*/
#include<bits/stdc++.h>
#define ll long long
using namespace std; int n,k,ans=1; int main(){
scanf("%d%d",&n,&k);
for(int i=0;i<=30;i++) if((1<<i)&n) ans<<=1;
for(int i=29;i>=0;i--) if(!((1<<i)&n)&&(1<<(i+1))<=k) k-=1<<(i+1);
printf("%d\n",k==0?ans:0);
return 0;
}

  

最新文章

  1. 精华 对express中next函数的一些理解
  2. AJAX跨域
  3. BZOJ4117 : [Wf2015]Weather Report
  4. overfit &amp; underfit
  5. linq分页扩展(转)
  6. Html下拉框的定义以及JS、Jquary取值、添加和移除
  7. in/exists not in/not exists null
  8. 51nod 1257 背包问题 V3
  9. TRANSLATE
  10. Codeforces 381 简要题解
  11. requirejs 合并方案
  12. CentOS环境下R语言的安装和配置
  13. javascript系列之核心知识点(一)
  14. css2.1实现图片添加阴影效果
  15. win7下 mysql安装(mysql-5.7.18-winx64.zip)
  16. Android 崩溃优化
  17. 确定有穷自动机(DFA)的化简(最小化)
  18. [精华][推荐] CAS SSO单点登录环境搭建及实例
  19. Linux:Day4(下) 用户及组管理
  20. useful tips for python

热门文章

  1. 2016.5.19——vector型的输入输出
  2. Java枚举类型的用法
  3. Hibernate5笔记2--单表的增删改查操作
  4. local variables referenced from a Lambda expression must be final or effectively final------理解
  5. phpStudy apache无法启动 apache启动后又停止
  6. OpenFlow1.3协议wireshark抓包分析
  7. codevs 1230 元素查找
  8. Python构造方法、析构方法和单例模式
  9. 002_curl及postman专题
  10. keras LSTM中间的dropout