Pagini recente » Cod sursa (job #2714957) | Cod sursa (job #2824647) | Cod sursa (job #2928118) | Cod sursa (job #2875577) | Cod sursa (job #1096377)
#include <stdio.h>
#include <map>
using namespace std;
int T, count;
map <int, int> M;
int main ()
{
freopen ("hashuri.in", "r", stdin);
freopen ("hashuri.out", "w", stdout);
scanf ("%d", &T);
while (T--)
{
int type, x;
scanf ("%d %d", &type, &x);
if (type == 1 && M.find (x) == M.end ()) M[x] = ++count;
if (type == 2) M.erase (x);
if (type == 3) printf ("%d\n", M.find (x) != M.end ());
}
return 0;
}