Pagini recente » Cod sursa (job #1030597) | Cod sursa (job #3134187) | Cod sursa (job #2136439) | Cod sursa (job #2532107) | Cod sursa (job #2187365)
#include <cstdio>
#include <map>
using namespace std;
map <int, int> m;
int main()
{
freopen("hashuri.in", "r", stdin);
freopen("hashuri.out", "w", stdout);
int n;
scanf("%d", &n);
int nr = 0;
for(int i=0; i<n; i++)
{
int t, x;
scanf("%d%d", &t, &x);
if(t == 1 && m.find(x) == m.end()) m[x] = ++nr;
else if(t == 2) m.erase(x);
else if(t == 3) printf("%d\n", m.find(x) != m.end());
}
return 0;
}