hdu acm1564Problem 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 having the first move

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/16 14:50:49
hdu acm1564Problem 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 having the first move

hdu acm1564Problem 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 having the first move
hdu acm1564
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

hdu acm1564Problem 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 having the first move
画图便可得到规律:
偶数时:8600胜
奇数时:ailyanlu胜
代码:
#include
int main()
{
int n;
while(scanf("%d",&n),n)
{
if(0==n%2)
puts("8600");
else
puts("ailyanlu");
}
return 0;
}