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