Pagini recente » Cod sursa (job #1433964) | Cod sursa (job #2013267) | Cod sursa (job #2036664) | Cod sursa (job #1295544) | Cod sursa (job #2744945)
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
unordered_map <int, int> M;
int main()
{
int n,op,x;
fin>>n;
for (int i=0; i<n; i++)
{
fin>>op>>x;
if ((op == 1)&&(M.find(x) == M.end())) M[x] = 1;
else if ((op == 2)&&(M.find(x) != M.end())) M.erase(x);
else if (op == 3)
{
if (M.find(x) == M.end())
fout<<0<<endl;
else fout<<1<<endl;
}
}
fin.close();
fout.close();
return 0;
}