Pagini recente » Cod sursa (job #820060) | Cod sursa (job #2910317) | Cod sursa (job #1459247) | Cod sursa (job #2679263) | Cod sursa (job #239838)
Cod sursa(job #239838)
#include <cstdio>
#include <ext/hash_set>
int N;
__gnu_cxx::hash_set<int> S;
int main()
{
freopen("hashuri.in", "rt", stdin);
freopen("hashuri.out", "wt", stdout);
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;
}