题干:

New Year is Coming! 
ailyanlu is very happy today! and he is playing a chessboard game with 8600. 
The size of the chessboard is n*n. A stone is placed in a corner square. They play alternatively with 8600 having the first move. Each time, player is allowed to move the stone to an unvisited neighbor square horizontally or vertically. The one who can't make a move will lose the game. If both play perfectly, who will win the game?

Input

The input is a sequence of positive integers each in a separate line. 
The integers are between 1 and 10000, inclusive,(means 1 <= n <= 10000) indicating the size of the chessboard. The end of the input is indicated by a zero.

Output

Output the winner ("8600" or "ailyanlu") for each input line except the last zero. 
No other characters should be inserted in the output.

Sample Input

2
0

Sample Output

8600

解题报告:

找规律得偶数则先手胜,奇数则后手胜

贴两篇证明:

http://www.cnblogs.com/kuangbin/archive/2013/07/22/3204654.html

https://blog.csdn.net/topc0o0der/article/details/5928391

AC代码:

#include<bits/stdc++.h>using namespace std;int main()
{int n;while(~scanf("%d",&n) && n) {if((n&1) == 1) puts("ailyanlu");else puts("8600");}return 0 ;
}

【HDU - 1564 】Play a game (博弈问题,找规律,奇偶博弈)相关推荐

  1. hdu 1564 paly a game(博弈论找规律)

    找规律 因为两个人足够聪明,奇数a赢,偶数8赢 #include <iostream>using namespace std;int main() {int t;while(cin> ...

  2. 【HDU - 5881】Tea(思维,找规律)

    题干: Tea is good. Tea is life. Tea is everything. The balance of tea is a journey of pursuing balance ...

  3. HDU 5976 2016ICPC大连 F: Detachment(找规律)

    题意: 将n拆成a1+a2+a3+-+ax的形式(ai≠aj),让a1*a2*a3*-*ax的值最大,求这个最大值 找规律 n=35:2+3+4+5+6+7+8:      max:2*3*4*5*6 ...

  4. 数学--数论--HDU 2582 F(N) 暴力打表找规律

    This time I need you to calculate the f(n) . (3<=n<=1000000) f(n)= Gcd(3)+Gcd(4)+-+Gcd(i)+-+Gc ...

  5. HDU - 1597 find the nth digit 【找规律】

    Description 假设: S1 = 1 S2 = 12 S3 = 123 S4 = 1234 ......... S9 = 123456789 S10 = 1234567891 S11 = 12 ...

  6. HDU 1564 简单博弈 水

    n*n棋盘,初始左上角有一个石头,每次放只能在相邻的四个位置之一,不能操作者输. 如果以初始石头编号为1作为后手,那么对于每次先手胜的情况其最后一步的四周的编号必定是奇数,且此时编号为偶数,而对于一个 ...

  7. 【HDU - 5963】朋友(博弈,思维,必胜态必败态,找规律)

    题干: B君在围观一群男生和一群女生玩游戏,具体来说游戏是这样的: 给出一棵n个节点的树,这棵树的每条边有一个权值,这个权值只可能是0或1. 在一局游戏开始时,会确定一个节点作为根.接下来从女生开始, ...

  8. hdu 1599 find the mincost route(找无向图最小环)(floyd求最小环)

    ps(我到今天才知道Floyd的核心思想是动态规划==) hdu 1599 find the mincost route(找无向图最小环) 注意!这里写成   #define data 0x3f3f3 ...

  9. 点分治问题 ----------- P3727 曼哈顿计划E[点分治+博弈SG函数打表找规律]

    题目链接 解题思路: 1.首先对于每个操作我们实际上是一个博弈问题 对于k=1的操作就是很基础的NIM游戏就是找到一条链的异或和为0 对于k=2的操作通过达打表找规律: 如果s是奇数那么偶数的SG函数 ...

最新文章

  1. debstack 安装 openstack
  2. iOS开发入门知识归纳
  3. 第五讲 Python中的字符串(一)
  4. html的选择器child,css child选择器妙用
  5. 茅塞顿开:Spring Aware原理解析
  6. 我的工作日志 - 2020年9月29日 星期二 晴
  7. mysql php7安装配置_centos7无网络下安装部署php7.1.33+mysql5.7.28+apache2.4.6-Go语言中文社区...
  8. pyinstaller打包的文件运行失败:numpy.core.multiarray failed to import
  9. 监控PGA最大空间、分配
  10. 正则表达式常用的js验证
  11. 7月最强书单丨博文视点新品畅销TOP10,让技术带你燃爆整个7月
  12. jQuery插件开发代码
  13. JCreator中怎样带参数运行程序,如何添加JDBC驱动程序
  14. 跨时代作品:超级IE缓存提取器
  15. @PathVariable注解是什么?
  16. linux 进程共享内存同步,Linux使用共享内存通信的进程同步退出问题
  17. [转载] 晓说——第1期:揭秘游戏规则奥斯卡走下“神坛“
  18. cad抠图 lisp_用Autolisp对AutoCAD进行二次改造
  19. pyqt:让qlabel的图片根据鼠标指向的位置进行放缩
  20. linux驱动21:内核创建类class_create

热门文章

  1. Hihocoer 1336 - Matrix Sum 二维树状数组
  2. linux验证cuda安装成功_Linux环境CUDA 4.0入门:验证安装
  3. 软件测试之逻辑覆盖测试理论总结(白话文)
  4. C# winform中判断控件类型
  5. python的模块导入问题_python导入模块错误怎么解决
  6. win32 ipv6 sendto recvfrom
  7. linux 内核 企鹅,Linux 内核 Makefile 体系简单分析
  8. python多级字典_Python多层字典取值
  9. 微服务 前台调用后台的慢的原因_20年IT农民工分享SpringCloud微服务架构实战文档...
  10. arcgis字段计算器利用python按两列要求编号