翻硬币游戏,纯。。

注意要判重

 #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std; int a[],n; int sg(int x){
int tmp=x,cnt=;
while(x){
if(x&==) cnt++;
x=(x>>);
}
if(cnt%==)
return *tmp;
else
return *tmp+;
} int main(){
while(scanf("%d",&n)!=EOF){
for(int i=;i<n;i++)
scanf("%d",&a[i]);
sort(a,a+n);
int len=-; int tmp=-;
for(int i=;i<n;i++){
if(a[i]!=tmp){
tmp=a[i];
a[++len]=a[i];
}
}
int sum=;
for(int i=;i<=len;i++)
sum^=sg(a[i]);
if(sum) printf("No\n");
else printf("Yes\n");
}
return ;
}

最新文章

  1. java web学习总结(二十九) -------------------JavaBean的两种开发模式
  2. 2016 Multi-University Training Contest 1 G. Rigid Frameworks
  3. 7、ASP.NET MVC入门到精通——第一个ASP.NET MVC程序
  4. Organize Your Train part II-POJ3007模拟
  5. linux 学习3 第四讲 文件常用命令
  6. 用POI读取具有任意合并单元的excel数据
  7. 点击验证码刷新(tp3.1)--超简单
  8. RocEDU.阅读.写作《图解TCP/IP》
  9. Echart多图联动
  10. LoaderManager使用详解(三)---实现Loaders
  11. gif格式的图片不能存在与包含js目录的路径中?
  12. PHP如何让apache支持.htaccess 解决Internal Server Error The server …错误
  13. Android -- 双击退出
  14. datagrid标题头粗体
  15. noip 2016 提高组总结(不是题解)
  16. Java 技术笔记
  17. tensorflow例子-【老鱼学tensorflow】
  18. 4,postman和newman的联合使用
  19. 测试开发之Django——No5.Django项目的部署(CentOS7+nginx)
  20. POP3_关于 multipart/related;boundary=

热门文章

  1. B1391 [Ceoi2008]order 最大权闭合图 最小割
  2. Java-java-com-util-common-service:ServiceException.java
  3. Check the difficulty of problems(概率+DP)
  4. Appium - 命令行参数
  5. ride关键字
  6. Servlet初始化与异步支持
  7. C#开发微信公众号——网页开发之微信网页授权
  8. poj3669 广搜
  9. ie8及其以下版本兼容性问题之placeholder实现
  10. 【Hexo】deploy出错的解决方法