Play a game

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1182    Accepted Submission(s): 969

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
 
Author
ailyanlu
 
Source
 
Recommend
8600   |   We have carefully selected several similar problems for you:  1404 1524 1729 1730 1849 
 
 //0MS    228K    195 B    G++
/* 题意:
有一块石头在某个角,两个人轮着推,无法推时输 博弈:
水题 */
#include<stdio.h>
#include<string.h>
int main(void)
{
int n;
while(scanf("%d",&n),n)
{
if(n%) puts("ailyanlu");
else puts("");
}
return ;
}

hdu 1564 Play a game (博弈)的更多相关文章

  1. HDU 1564 简单博弈 水

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

  2. HDU 1524 树上无环博弈 暴力SG

    一个拓扑结构的图,给定n个棋的位置,每次可以沿边走,不能操作者输. 已经给出了拓扑图了,对于每个棋子找一遍SG最后SG和就行了. /** @Date : 2017-10-13 20:08:45 * @ ...

  3. 取石子游戏 HDU 1527 博弈论 威佐夫博弈

    取石子游戏 HDU 1527 博弈论 威佐夫博弈 题意 有两堆石子,数量任意,可以不同.游戏开始由两个人轮流取石子.游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子:二是可以在两 ...

  4. HDU 1564 Play a game && HDU 2147 kiki's game

    HDU 1564 Play a game题意: 棋盘的大小是n*n.一块石头被放在一个角落的广场上.他们交替进行,8600人先走.每次,玩家可以将石头水平或垂直移动到一个未访问的邻居广场.谁不采取行动 ...

  5. HDU 1564 找规律博弈

    题目大意是: 从n*n的方格角落的一个起点出发,每次移到上下左右一个未曾到达过的位置,谁不能走了谁就输了 想了好久都想不出,看了大神的题解 Orz了 果然博弈不是脑残的游戏啊... 这里从起点出发,将 ...

  6. 题解报告:hdu 1564 Play a game(找规律博弈)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1564 Problem Description New Year is Coming! ailyanlu ...

  7. HDU 1564 Play a game(巴什博弈)

    New Year is Coming! ailyanlu is very happy today! and he is playing a chessboard game with 8600. The ...

  8. HDU 1564 (博弈) Play a game

    这道题的答案猜也很好猜出来,但是想太难想了..题解一贴,然后闪人.. 请戳这

  9. HDU 1564 Play a game (找规律博弈)

    Play a game Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...

随机推荐

  1. Erwin 简单使用

    1. 物理设计:汉译英过程 ① Logical 中操作:Tools-Names-Edit Naming Standards…-Glossary选项import,导入内容为编辑好的CSV文件(只包含中文 ...

  2. 总结JavaScript常用数组操作方法,包含ES6方法

    一.concat() concat() 方法用于连接两个或多个数组.该方法不会改变现有的数组,仅会返回被连接数组的一个副本. var arr1 = [1,2,3]; var arr2 = [4,5]; ...

  3. JS - 给数组的原型添加去掉重复元素的distinct方法

    /* 调用完该方法,原数组只留下非重复的数据 返回一个数组,里面是依次出现的重复元素 */Array.prototype.distinct = function () {    var removeA ...

  4. tomcat日志切割脚本

    tomcat日志每俩小时切割的脚本如下(这是用定时任务来完成的,此方法无需重启tomcat): time=$(date +%H) end_time=`` a=$end_time BF_TIME=$(- ...

  5. 图解HTTP总结(5)——与HTTP协作的Web服务器

    一台 Web 服务器可搭建多个独立域名的 Web 网站, 也可作为通信路径上的中转服务器提升传输效率. 用单台虚拟主机实现多个域名 HTTP/1.1 规范允许一台 HTTP 服务器搭建多个 Web 站 ...

  6. Huffman Tree -- Huffman编码

    #include <stdlib.h> #include <stdio.h> #include <string.h> typedef struct HuffmanT ...

  7. liteos学习文档liteos.github.io

    https://liteos.github.io该主页是华为liteos物联网操作系统的文档,里面有一章是“内核指南”,讲的是rtos的最主要的功能.可以当作liteos的入门了解,如果用rtos的使 ...

  8. ABAP News for Release 7.51 – ABAP CDS Client Handling

    Open SQLは自動的クライアント処理をサポートしています. Open SQLでクライアント依存のデータソースにアクセスする時.デフォルトでは現在のクライアントのデータだけが考慮されます. クライア ...

  9. PHP.20-图片上传下载

    图片上传下载 思路: 1.创建图片上传的存放目录 /uploads/ 2.index.php //浏览页面,提供上传表单 上传表单:文件上传必须使用enctype="multipart/fo ...

  10. Lambda与LINQ

    Lambda与LINQ写法对比: 上为Lambda 下为LINQ 显示指定列 Students.select(u=>(new {Name=u.Sname,Address=u.Saddress}) ...