10 8CHANGE 1QUERYCHANGE 2QUERYCHANGE 1CHANGE 9CHANGE 7QUERY样例输出123#include<stdio.h>#include<string.h>int main(){ int number,time; while(scanf("%d%d",&number,&time)!=EOF) { int count=0; char str[20]; int arr[number+1]; memset(arr,0,sizeof(arr)); getchar(); while(time--) { gets(str); if(str[0]=='Q') { PRintf("%d/n",count); } else { char *p=str; while(*p!=' ') { p++; } int num=0; p++; while(*p) { num=num*10+*p-'0'; p++; } // printf("num:%d arr[%d]:%d/n",num,num,arr[num]); if(arr[num]==0) { arr[num]=1; count++; } else if(arr[num]==1) { arr[num]=0; count--; } } } } return 0;}
新闻热点
疑难解答