Pagini recente » Cod sursa (job #3197374) | Cod sursa (job #388455) | Cod sursa (job #35684) | Cod sursa (job #2732590) | Cod sursa (job #239836)
Cod sursa(job #239836)
#include <cstdio>
#include <hash_set>
using namespace std;
using namespace __gnu_cxx;
int N;
hash_set<int> S;
int main()
{
freopen("hashuri.in", "rt", stdin);
#ifndef DEBUG
freopen("hashuri.out", "wt", stdout);
#endif
scanf("%d", &N);
for (; N; N--)
{
int type, val;
scanf("%d %d", &type, &val);
if (type == 1)
S.insert(val);
if (type == 2)
S.erase(val);
if (type == 3)
printf("%d\n", (S.find(val) != S.end()));
}
return 0;
}