Hdoj 1564 Play a game

Source: Internet
Author: User

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 descriptionnew 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 has the first move. Each time, player was allowed to move the stone to an unvisited neighbor square horizontally or vertically. The one can ' t make a move would lose the game. If both play perfectly, who would win the game?

Inputthe input is a sequence of positive integers each in a separate line.
The integers is 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.

Outputoutput the winner ("8600" or "Ailyanlu") for each input line except the last zero.
No other characters should is inserted in the output.

Sample Input2 0

Sample Output8600 rule when the n*n is even, the output 8600 is an odd output Ailyanlu
#include <stdio.h>int main () {int n,m,j,i;while (scanf ("%d", &n), N) {if ((n*n) &1) printf ("ailyanlu\n"); elseprintf ("8600\n");} return 0;}

Hdoj 1564 Play a game

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.