Pagini recente » Cod sursa (job #734692) | Cod sursa (job #1950028) | Cod sursa (job #1758474) | Cod sursa (job #1359154) | Cod sursa (job #1819894)
#include <bits/stdc++.h>
using namespace std;
map <int, int> v;
int main()
{
ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");
int n, x, op, i;
fin >> n;
for (i = 0; i<n; ++i)
{
fin >> op >> x;
if (op == 1 && v.count(x) == 0)
v[x] = 1;
if (op == 2 && v.count(x) == 1)
v.erase (x);
if (op == 3)
{
if (v.count(x))
fout << 1 << '\n';
else fout << 0 << '\n';
}
}
return 0;
}