Pagini recente » Cod sursa (job #1854412) | Cod sursa (job #1886120) | Cod sursa (job #1987683) | Cod sursa (job #2268237) | Cod sursa (job #2928078)
#include <bits/stdc++.h>
using namespace std;
ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");
int n, op, x;
map <int, bool> M;
int main()
{
fin >> n;
for (int i = 1; i <= n; i++)
{
fin >> op >> x;
if (M.find(x) != M.end())
{
if (op == 2)
M.erase(x);
else if (op == 3)
fout << 1 << '\n';
}
else
{
if (op == 1)
M[x] = 1;
else if (op == 3)
fout << 0 << '\n';
}
}
return 0;
}