标签:io os for sp c amp r as hdu
//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; }
标签:io os for sp c amp r as hdu
原文地址:http://blog.csdn.net/lp_opai/article/details/39297105