#include <bits/stdc++.h>
using namespace std;
int main()
{
int N,K,i,count=0,X;
string s;
int a[1000]={0};
cin >> N >> K;
for (i=0;i<=K;i++)
{
cin >> s;
if (s[2]=='I')
{
cin >> X;
if (a[X]==0)
{
a[X]=1;
count++;
}
else
{
a[X]=0;
count--;
}
cout<<count<<endl;
}
else if (s[2]=='O')
{
count=0;
for(i=1;i<=N;i++)
a[i]=0;
cout<<count<<endl;
}
}
return 0;
}Asked by: Rishav_Mundhra on April 7, 2019, 6:34 p.m. Last updated on April 7, 2019, 6:34 p.m.