hdu 5011 nim博弈 (2014西安网赛E题)
n堆石子,每次可以选一堆取走至少一个,之后你可以不操作或者把该堆石子分成两堆,每堆至少一个,和还是原来(取完石子后)的石子个数。
Sample Input
1
1
2
1 1
3
1 2 3
Sample Output
Win
Lose
Lose
# include <iostream>
# include <cstdio>
# include <cstring>
# include <string>
# include <algorithm>
# include <cmath>
# include <queue>
# define LL long long
using namespace std ; int main ()
{
// freopen("in.txt","r",stdin) ;
int n ;
while(scanf("%d" , &n) != EOF)
{
int i , x ;
int sum = ;
for (i = ; i <= n ; i++)
{
scanf("%d", &x) ;
sum ^= x ;
}
if (sum)
printf("Win\n") ;
else
printf("Lose\n") ;
} return ;
}
hdu 5011 nim博弈 (2014西安网赛E题)的更多相关文章
- hdu 5007 水题 (2014西安网赛A题)
题意:出现Apple.iPod.iPhone.iPad时输出MAI MAI MAI!,出现Sony,输出SONY DAFA IS GOOD! Sample InputApple bananaiPad ...
- ACM学习历程——HDU5017 Ellipsoid(模拟退火)(2014西安网赛K题)
---恢复内容开始--- Description Given a 3-dimension ellipsoid(椭球面) your task is to find the minimal distanc ...
- ACM学习历程——HDU 5014 Number Sequence (贪心)(2014西安网赛)
Description There is a special number sequence which has n+1 integers. For each number in sequence, ...
- hdu 5053 (2014上海网赛L题 求立方和)
题目大意:给你L到N的范围,要求你求这个范围内的所有整数的立方和. Sample Input2 //T1 32 5 Sample OutputCase #1: 36Case #2: 224 # inc ...
- hdu 5003 模拟水题 (2014鞍山网赛G题)
你的一系列得分 先降序排列 再按0.95^(i-1)*ai 这个公式计算你的每一个得分 最后求和 Sample Input12530 478Sample Output984.1000000000 # ...
- HDU 5011 NIM博弈
http://www.cnblogs.com/exponent/articles/2141477.html http://acm.hust.edu.cn/vjudge/contest/122814#p ...
- ACM学习历程—HDU 5012 Dice(ACM西安网赛)(bfs)
Problem Description There are 2 special dices on the table. On each face of the dice, a distinct num ...
- HDU 5009 Paint Pearls(西安网络赛C题) dp+离散化+优化
转自:http://blog.csdn.net/accelerator_/article/details/39271751 吐血ac... 11668627 2014-09-16 22:15:24 A ...
- 2014西安现场赛F题 UVALA 7040
地址 题意:求在m种颜色中挑选k种颜色,给n个花朵涂色有几种方法. 分析:画图可以发现,基本的公式就是k ×(k-1)^(n-1).但这仅保证了相邻颜色不同,总颜色数不超过k种,并没有保证恰好出现k种 ...
随机推荐
- MySQL 5.7基于组提交的并行复制
参考链接: http://mysql.taobao.org/monthly/2016/08/01/ https://www.kancloud.cn/thinkphp/mysql-parallel-ap ...
- CodeForces - 707C
C. Pythagorean Triples time limit per test 1 second memory limit per test 256 megabytes input standa ...
- MT【91】空间余弦定理
评:空间余弦定理:空间四边形$ABCD$中$cos<AC,BD>=\frac{|(|AB|^2+|CD|^2)-(|BC|^2+|AD|^2)}{2|AC||BD|}$,证明用向量.
- BZOJ3738 [Ontak2013]Kapitał 【扩展Lucas】
题目链接 BZOJ3738 题解 复习 同上 但是为了消去因子\(10\),处理\(2^k\)的时候,乘回\(2^{k_1}\)时,应同时计算\(5^{k_2}\) 如果\(k_1 \ge k_2\) ...
- 洛谷 P1437 [HNOI2004]敲砖块 解题报告
P1437 [HNOI2004]敲砖块 题目描述 在一个凹槽中放置了 n 层砖块.最上面的一层有n 块砖,从上到下每层依次减少一块砖.每块砖 都有一个分值,敲掉这块砖就能得到相应的分值,如下所示. 1 ...
- codeblocks编译器
发现网络有些编译器没有MinGW,特此留一文件: https://pan.baidu.com/s/1pLltzvH 有时下载codeblocks后编译不了,还要修改MinGW的位置,找到MinGW文件 ...
- Hadoop Yarn源码 - day1
Hadoop 2.6.0下面的关于Yarn工程,如下所示,主要有以下七个module: hadoop-yarn-api:和外部平台交互的接口 hadoop-yarn-applications hado ...
- 如何设置Ultraedit自动换行
有时候这会非常麻烦, 要让Ultraedit自动换行请按发下方法: 1. 点击菜单栏的"高级→配置",找到"编辑器→自动换行/制表符设置". 2. 然后,把&q ...
- 使用 SP_OAXXX 创建文件夹,注意区别于 xp_cmdshell --mkdir xxx
sp_configure 'show advanced options',1 go reconfigure with override go sp_configure 'Ole Automation ...
- Does Deep Learning Come from the Devil?
Does Deep Learning Come from the Devil? Deep learning has revolutionized computer vision and natural ...