Cod sursa(job #976122)
Utilizator | Data | 22 iulie 2013 16:34:13 | |
---|---|---|---|
Problema | Hashuri | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.48 kb |
#include <stdio.h>
#include <algorithm>
#include <map>
using namespace std;
int main()
{
int i, N, op, x, nr;
map<int, int> myset;
freopen("hashuri.in", "r", stdin);
freopen("hashuri.out", "w", stdout);
scanf("%d", &N);
for(i = 1; i <= N; ++i)
{
scanf("%d%d", &op, &x);
switch(op)
{
case 1:
myset[x] = ++nr;
case 2:
myset.erase(x);
break;
case 3:
printf("%d\n", myset.find(x) != myset.end());
break;
}
}
return 0;
}