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. 下载APP 2个二维码合并到一个二维码

    <html> <head> <meta http-equiv="Content-Type" content="text/html; char ...

  2. 阻止CSS样式被缓存

    <link href="/stylesheet.css?<?php echo time(); ?>" rel="stylesheet" typ ...

  3. Django生产环境的部署-Apache-mod_wsgi

    httpd.conf配置 ServerSignature On ServerTokens Full Define APACHE24 Apache2.4 Define SERVER_BASE_DIR & ...

  4. [python]filter

  5. USB Key插入和移除监控

    近期在做USB Key插入和移除监控,已经做到了插入和移除USB Key时,程序能够及时感应到. 如下为源代码: private void Form1_Load(object sender, Even ...

  6. AppStore IPv6-only审核被拒原因分析及解决方案-b

    自2016年6月1日起,苹果要求所有提交App Store的iOS应用必须支持IPv6-only环境,背景也是众所周知的,IPv4地址已基本分配完毕,同时IPv6比IPv4也更加高效,向IPv6过渡是 ...

  7. Discuz!X3.1 全新安装图文教程

    http://www.discuz.net/thread-3456887-1-1.html

  8. 【Xamarin挖墙脚系列:Xamarin4.0的重大变更】

    原文:[Xamarin挖墙脚系列:Xamarin4.0的重大变更] Windows下的变更不大,主要还是bug 的修复,性能的优化,API的扩展实现. 变化最大的是在Mac上的那个Xamarin.iO ...

  9. 公告: 新博客已经迁移到 www.root.run

    root.run www.root.run www.root.run/sitemap.html www.root.run/sitemap.xml

  10. JAVA 内存泄漏与内存溢出

    一.Java内存回收机制 不论哪种语言的内存分配方式,都需要返回所分配内存的真实地址,也就是返回一个指针到内存块的首地址.Java中对象是采用new或者反射或者clone或者反序列化的方法创建的, 这 ...