//nim博弈 //有n堆石头,两人轮流每次从一堆中拿至少1,之多全部的石头,没有石头可拿为lose //判断先手是win还是lose # include <stdio.h> # include <algorithm> # include <string.h> using namespace std; int main() { int n,i; __int64 a,sum; while(~scanf("%d",&n)) { sum=0; for(i=0; i<n; i++) { scanf("%I64d",&a); sum^=a; } if(sum==0) printf("Lose\n"); else printf("Win\n"); } return 0; }
时间: 2024-10-11 23:37:34