Pagini recente » Cod sursa (job #530914) | Cod sursa (job #142828) | Cod sursa (job #945919) | Cod sursa (job #2563450) | Cod sursa (job #1467271)
#include <fstream>
#include <map>
#include <unordered_map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int N,K;
//map <int, int> H;
unordered_map<int, int> H;
int main()
{
f>>N;
for(int i=1;i<=N;++i)
{
int tip,x;
f>>tip>>x;
if (tip==1 && H.find(x)==H.end()) H[x] = ++K;
if (tip==2) H.erase(x);
if (tip==3) g<<(H.find(x)!=H.end())<<'\n';
}
f.close();g.close();
return 0;
}