Pagini recente » Cod sursa (job #3164597) | Cod sursa (job #1021298) | Cod sursa (job #256551) | Cod sursa (job #2320121) | Cod sursa (job #2745647)
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");
unordered_map<int, int> hashuri;
int n,y;
long long x;
int main()
{
fin>>n;
for(int i=1;i<=n;i++)
{
fin>>y>>x;
if(y == 1)
{ hashuri[x]=1; }
else if(y == 2)
{ hashuri.erase(x); }
else if(y == 3)
{
if(hashuri.find(x) != hashuri.end())
fout<<1<<endl;
else
fout<<0<<endl;
}
}
return 0;
}