hdu-2509 Be the Winner
来源:互联网 发布:java final成员变量 编辑:程序博客网 时间:2024/05/01 06:11
http://acm.hdu.edu.cn/showproblem.php?pid=2509
跟1907一样, 题目意思也是 n堆苹果,轮流操作求谁胜谁负。
#include<cstdio>int main(){ int n,a,sum,s; while(scanf("%d",&n)!=EOF) { sum=0; s=0; for(int i=0;i<n;i++) { scanf("%d",&a); s^=a; sum+=a; } if(sum==n)//全部为孤单堆 { if(sum%2==0) printf("Yes\n"); else printf("No\n"); } else { if(s==0) printf("No\n"); else printf("Yes\n"); } } return 0;}
0 0
- hdu 2509 Be the Winner
- HDU 2509 Be The Winner
- hdu-2509 Be the Winner
- hdu 2509 Be the Winner
- HDU 2509 Be the Winner
- HDU 2509 Be the Winner
- HDU 2509 Be the Winner
- HDU 2509 Be the Winner
- hdu 2509 Be the Winner
- hdu 2509 Be the Winner
- HDU 2509 Be The Winner ( Nim 博弈 )
- hdu 2509 Be the Winner 1907 John
- hdu 2509 Be the Winner(博弈)
- hdu 2509 - Be the Winner(简单博弈)
- [博弈]HDU 2509 Be the Winner
- HDU 2509 -Be the Winner/ZOJ3113
- hdu 2509 Be the Winner(博弈)
- hdu 2509 Be the Winner(博弈Nim)
- Maven 学习记录
- .NET API for RabbitMQ and ActiveMQ
- 每日算法之二十六:Substring with Concatenation of All Words
- 算法竞赛入门经典训练指南
- LNMP一键安装包 V1.1 发布
- hdu-2509 Be the Winner
- Windows 上同时使用Python2.x 与 3.x
- EM算法
- /proc文件系统
- 如何成为坐拥百万的WEB开发者
- Copy-and-swap
- Virtualbox虚拟Ubuntu共享文件夹设置
- 谈谈防 SQL 注入式攻击策略
- 工具类commons-io的文件监控