原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1564

Play a game

Problem Description

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

题解

很显然的一道题,石子可以上下左右移动到没有到过的格子,而石子肯定可以遍历整个棋盘,所以我们只需要看格子数是奇是偶就可以判断了。

代码
#include<bits/stdc++.h>
using namespace std;
int n;
void ac()
{if(n%2)printf("ailyanlu\n");else printf("8600\n");
}
int main()
{while(scanf("%d",&n)&&n)ac();return 0;
}

HDU1564 Play a game相关推荐

  1. 简单博弈论总结加例题解析

    (一)巴什博奕(Bash Game):只有一堆n个物品,两个人轮流从这堆物品中取物,规 定每次至少取一个,最多取m个.最后取光者得胜. 显然,如果n=m+1,那么由于一次最多只能取m个,所以,无论先取 ...

  2. ACM 各大OJ平台以及题目分类

    本文章转自:http://blog.csdn.net/liujiuxiaoshitou/article/details/7 OJ是Online Judge系统的简称,用来在线检测程序源代码的正确性.著 ...

  3. ACM OJ 平台以及平台题目分类

    OJ是Online Judge系统的简称,用来在线检测程序源代码的正确性.著名的OJ有RQNOJ.URAL等.国内著名的题库有北京大学题库.浙江大学题库等.国外的题库包括乌拉尔大学.瓦拉杜利德大学题库 ...

最新文章

  1. 解密「天池」:如何做好一场万人AI竞赛的「大后方」?
  2. 《Hadoop基础教程》之初识Hadoop
  3. 杂记整理二:linux与程序安装
  4. 神经网络与定态薛定谔方程
  5. cmake / cmake --build 如何理解
  6. Django从理论到实战(part49)--ModelForm
  7. jvm内存结构_聊聊JVM内存结构
  8. fitbit手表中文说明书_我如何分析FitBit中的数据以改善整体健康状况
  9. 必须掌握的Java基础知识(一)
  10. 【mysql】期末数据库复习指南(《数据库系统概率》知识点总结,数据库系统原理,数据库设计课程复习)
  11. install-newton部署安装--------计算节点部署安装
  12. linux跟踪函数代码,linux ltrace-跟踪进程调用库函数的情况
  13. 网站安全之存储型跨站脚本编制
  14. To prevent a memory leak the JDBC Driver has been forcibly
  15. 在桌面计算机找不到驱动,电脑杀毒后桌面不见了的原因是什么_怎么解决 - 驱动管家...
  16. An Improved One millisecond Mobile Backbone 论文笔记
  17. ffmpeg rtmp推流代码示例
  18. bzoj4372 烁烁的游戏 动态点分治+线段树
  19. *5-2 CCF 2014-12-3 集合竞价
  20. 一文读懂机器学习,大数据/自然语言处理/算法全有了……

热门文章

  1. SpringMVC初写(四)上传和下载功能的实现
  2. TypeScript入门教程
  3. 2018-01-29(HTML+CSS)
  4. Java基础知识强化之集合框架笔记15:List集合的特点
  5. IOS UI TabBar标签栏的使用
  6. [转帖]Android Bitmap内存限制OOM,Out Of Memory
  7. java垃圾收集器、Serial收集器、ParNew收集器、Parallel Scavenge收集器、Serial Old 收集器、CMS收集器、G1收集器、如何查看GC日志
  8. mysql 分库外置索引,MySQL的分库分表与Innodb的Btree索引
  9. equals和==比较
  10. css 为什么给span加vertical-align: middle不起作用?