题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1564
题意:给一个n*n大的棋盘,8600先走,只能水平或者竖直走一步,走过的就不能再走了。最后无路可走的就输了。先手赢输出8600,否则输出ailyanlu。
看了聚聚的题解,,好巧妙啊怎么自己没想出来。。。
S表示起点。
如果n为偶数,那么所有格子可以被2*1的砖块覆盖掉。
这样先手每次都移动到当前1*2的另外一块。先手必赢。
如果n为奇数。出了起始那个店,其余点都可以被覆盖,后手必赢。
参考博客:http://www.cnblogs.com/kuangbin/archive/2013/07/22/3204654.html
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int main() {
int n;
while(~scanf("%d", &n), n) {
if(n % 2 == 0) puts("8600");
else puts("ailyanlu");
}
return 0;
}