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