poj 1740 A New Stone Game
#include<stdio.h> #include<string.h> bool flag[110]; int main() { int n,i,x; int js; while(scanf("%d",&n)!=EOF&&n) { memset(flag,0,sizeof(flag)); js=0; for(i=0;i<n;i++) { scanf("%d",&x); flag[x]=1^flag[x]; if(flag[x])js++; else js--; //printf("%d ",ans); } //printf("%d ",ans); if(js)printf("1\n"); else printf("0\n"); } return 0; }
只要开始不全是两两相等,那先取者必胜.