n堆石子,每次可以选一堆取走至少一个,之后你可以不操作或者把该堆石子分成两堆,每堆至少一个,和还是原来(取完石子后)的石子个数。

Sample Input
1
1
2
1 1
3
1 2 3

Sample Output
Win
Lose
Lose

  1. # include <iostream>
  2. # include <cstdio>
  3. # include <cstring>
  4. # include <string>
  5. # include <algorithm>
  6. # include <cmath>
  7. # include <queue>
  8. # define LL long long
  9. using namespace std ;
  10.  
  11. int main ()
  12. {
  13. // freopen("in.txt","r",stdin) ;
  14. int n ;
  15. while(scanf("%d" , &n) != EOF)
  16. {
  17. int i , x ;
  18. int sum = ;
  19. for (i = ; i <= n ; i++)
  20. {
  21. scanf("%d", &x) ;
  22. sum ^= x ;
  23. }
  24. if (sum)
  25. printf("Win\n") ;
  26. else
  27. printf("Lose\n") ;
  28. }
  29.  
  30. return ;
  31. }

hdu 5011 nim博弈 (2014西安网赛E题)的更多相关文章

  1. hdu 5007 水题 (2014西安网赛A题)

    题意:出现Apple.iPod.iPhone.iPad时输出MAI MAI MAI!,出现Sony,输出SONY DAFA IS GOOD! Sample InputApple bananaiPad ...

  2. ACM学习历程——HDU5017 Ellipsoid(模拟退火)(2014西安网赛K题)

    ---恢复内容开始--- Description Given a 3-dimension ellipsoid(椭球面) your task is to find the minimal distanc ...

  3. ACM学习历程——HDU 5014 Number Sequence (贪心)(2014西安网赛)

    Description There is a special number sequence which has n+1 integers. For each number in sequence, ...

  4. hdu 5053 (2014上海网赛L题 求立方和)

    题目大意:给你L到N的范围,要求你求这个范围内的所有整数的立方和. Sample Input2 //T1 32 5 Sample OutputCase #1: 36Case #2: 224 # inc ...

  5. hdu 5003 模拟水题 (2014鞍山网赛G题)

    你的一系列得分 先降序排列 再按0.95^(i-1)*ai 这个公式计算你的每一个得分 最后求和 Sample Input12530 478Sample Output984.1000000000 # ...

  6. HDU 5011 NIM博弈

    http://www.cnblogs.com/exponent/articles/2141477.html http://acm.hust.edu.cn/vjudge/contest/122814#p ...

  7. 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 ...

  8. HDU 5009 Paint Pearls(西安网络赛C题) dp+离散化+优化

    转自:http://blog.csdn.net/accelerator_/article/details/39271751 吐血ac... 11668627 2014-09-16 22:15:24 A ...

  9. 2014西安现场赛F题 UVALA 7040

    地址 题意:求在m种颜色中挑选k种颜色,给n个花朵涂色有几种方法. 分析:画图可以发现,基本的公式就是k ×(k-1)^(n-1).但这仅保证了相邻颜色不同,总颜色数不超过k种,并没有保证恰好出现k种 ...

随机推荐

  1. c++11 noexcept修饰符

    c++11 noexcept修饰符 #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <string> ...

  2. css 2D转换总结

    CSS中2D转换的形式是这样的: 选择器{ transform:转换函数(参数,参数): } 其中transform(是transform 不是transfrom)定义元素的2D或者3D转换: 2D转 ...

  3. Problem C Dist 解题报告

    Problem C Dist Description 有一个\(n\)个点带边权的连通无向图,边集用\(k\)个集合\(s_1,s_2,\dots,s_k\)和\(k\)个整数\(w_1,w_2,\d ...

  4. Dist

    Description 数据范围:\(1<=n<=10^5,1<=k<=18,1<=k_i<=10^7,\sum |s_i|<=3*10^5\) Soluti ...

  5. 使用Sql语句快速将数据表转换成实体类

    开发过程中经常需要根据数据表编写对应的实体类,下面是使用sql语句快速将数据表转换成对应实体类的代码,使用时只需要将第一行'TableName'引号里面的字母换成具体的表名称就行了: declare ...

  6. sqlserver收缩日志的几种方式

    sqlserver收缩日志的几种方式   [sql] --参考    压缩日志及数据库文件大小      /*--特别注意       请按步骤进行,未进行前面的步骤,请不要做后面的步骤    否则可 ...

  7. Go_21: Golang 中 time 包的使用二

    常量声明: const TimeLayout = "2006-01-02 15:04:05" 这是个奇葩,必须是这个时间点,据说是 go 诞生之日, 记忆方法:6-1-2-3-4- ...

  8. 基于docker的spark-hadoop分布式集群之二: 环境测试

    在上一章<环境搭建>基础上,本章对各个模块做个测试 Mysql 测试 1.Mysql节点准备 为方便测试,在mysql节点中,增加点数据 进入主节点 docker exec -it had ...

  9. C语言复习---获取矩阵的对角和

    #include <stdio.h> #include <stdlib.h> #include <math.h> #define MAX 5 int main() ...

  10. linux常用端口查询

    0 | 无效端口,通常用于分析操作系统1 | 传输控制协议端口服务多路开关选择器2 | 管理实用程序3 | 压缩进程5 | 远程作业登录7 | 回显9 | 丢弃11 | 在线用户13 | 时间17 | ...