标签:style http color io os ar for sp 代码
思路:其实就求一个Nim和即可,要推也不难推,和为0下一个必然是胜态,因为至少取走一个,在怎么分也达不到原来那个值了,如果是非0值,就和原来Nim一样必然可以取一堆使得变成0
代码:
#include <cstdio> #include <cstring> const int N = 100005; int n; long long a, sum; int main() { while (~scanf("%d", &n)) { sum = 0; for (int i = 0 ; i < n; i++) { scanf("%I64d", &a); sum ^= a; } if (sum == 0) printf("Lose\n"); else printf("Win\n"); } return 0; }
标签:style http color io os ar for sp 代码
原文地址:http://blog.csdn.net/accelerator_/article/details/39271829