Play a game

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

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
找规律 当n*n为偶数时输出8600是奇数输出ailyanlu
#include<stdio.h>
int main()
{
int n,m,j,i;
while(scanf("%d",&n),n)
{
if((n*n)&1)
printf("ailyanlu\n");
else
printf("8600\n");
}
return 0;
}
 

hdoj 1564 Play a game的更多相关文章

  1. 杭电hdoj题目分类

    HDOJ 题目分类 //分类不是绝对的 //"*" 表示好题,需要多次回味 //"?"表示结论是正确的,但还停留在模块阶 段,需要理解,证明. //简单题看到就 ...

  2. HDOJ 题目分类

    HDOJ 题目分类 /* * 一:简单题 */ 1000:    入门用:1001:    用高斯求和公式要防溢出1004:1012:1013:    对9取余好了1017:1021:1027:   ...

  3. HDOJ 1009. Fat Mouse' Trade 贪心 结构体排序

    FatMouse' Trade Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) ...

  4. HDOJ 2317. Nasty Hacks 模拟水题

    Nasty Hacks Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Tota ...

  5. HDOJ 1326. Box of Bricks 纯水题

    Box of Bricks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) To ...

  6. HDOJ 1004 Let the Balloon Rise

    Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...

  7. hdoj 1385Minimum Transport Cost

    卧槽....最近刷的cf上有最短路,本来想拿这题复习一下.... 题意就是在输出最短路的情况下,经过每个节点会增加税收,另外要字典序输出,注意a到b和b到a的权值不同 然后就是处理字典序的问题,当松弛 ...

  8. HDOJ(2056)&HDOJ(1086)

    Rectangles    HDOJ(2056) http://acm.hdu.edu.cn/showproblem.php?pid=2056 题目描述:给2条线段,分别构成2个矩形,求2个矩形相交面 ...

  9. BZOJ 1564: [NOI2009]二叉查找树

    链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1564 Description Input Output 只有一个数字,即你所能得到的整棵树的访 ...

随机推荐

  1. 清理SQL多余登录信息

    服务器列表.登陆帐户.密码等信息都记录在 %AppData%\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin (2008)%A ...

  2. 用Python实现的一个简单的随机生成器

    朋友在ctr工作,苦于各种排期神马的,让我帮他整一个xxxx管理系统 里面在用户管理上面需要有一个批量从文件导入的功能,我肯定不能用汉字来作唯一性约束,于是想到了随机生成. 我首先想到的是直接用ite ...

  3. Python Tips and Traps(一)

    1.如果想得到一个列表的index和内容,可以通过enumerate快速实现 drinks = ['coffee','tea', 'milk', 'water'] for index, drink i ...

  4. PhoneGap 3 在 Mac 上安装使用

    1.下载安装 NodeJS . 2.安装 PhoneGap.打开终端执行: 1 $ sudo npm install -g phonegap 3.PhoneGap 3 不需要在Xcode中创建,而是在 ...

  5. 个人学习笔记--MyBatis官方推荐DAO开发方案

    1.导入Jar包 2.编写全局配置文件configuration.xml <?xml version="1.0" encoding="UTF-8" ?&g ...

  6. C语言程序设计做题笔记之C语言基础知识(上)

    C语言是一种功能强大.简洁的计算机语言,通过它可以编写程序,指挥计算机完成指定的任务.我们可以利用C语言创建程序(即一组指令),并让计算机依指令行事.并且C是相当灵活的,用于执行计算机程序能完成的几乎 ...

  7. angularJS vs backbone

    http://alistapart.com/article/javascript-mvc http://blog.nebithi.com/backbone-and-angular-demystifyi ...

  8. 【HDU 5456】 Matches Puzzle Game (数位DP)

    Matches Puzzle Game Problem Description As an exciting puzzle game for kids and girlfriends, the Mat ...

  9. SpringSecurity的简单应用(一)

    java项目首先要提的就是jar包了,Springsecurity的jar下载地址:http://static.springsource.org/spring-security/site/downlo ...

  10. WEB 开发异常:java.lang.ClassNotFoundException

    某个类明明是有的,可是eclipse 启动tomcat服务器运行web项目,出现如题异常. java.lang.ClassNotFoundException 信息: Set web app root ...