题意:Nimm Game
思路:Nimm Game
#include<iostream> #include<stdio.h> using namespace std; int main(){ int m,a[128],i,sum,ans; while(~scanf("%d",&m)&&m){ sum=0; for(i=0;i<m;++i){ scanf("%d",&a[i]); sum^=a[i]; } if(sum){ ans=0; for(i=0;i<m;++i) if((sum^a[i])<a[i])++ans;//优先级 printf("%d ",ans); } else printf("0 "); } return 0; }