新手赛的题目,让我回想起打酱油的时光
int main()
{
int x;
bool first = 1;
//freopen("in.txt","r",stdin);
scanf("%d",&T);
while(T--)
{
if(first) first = 0;
else printf("/n");
buildTree(1,1,100000);
memset(R,0,sizeof(R));//标记是否remove过
memset(G,0,sizeof(G));//标记是否generate过
scanf("%d",&M);
while(M--)
{
scanf("%s",cmd);
if(cmd[0] == 'g')
{
scanf("%d",&x);
if(!G[x])
{
G[x] = 1;
Insert(1,x,x);
R[x] = 0;
}
}
if(cmd[0] == 'r')
{
scanf("%d",&x);
if(!R[x])
{
R[x] = 1;
Remove(1,x,x);
G[x] = 0;
}
}
if(cmd[0] == 'q') printf("%d/n",Query(1));
}
}
}