Pagini recente » Cod sursa (job #2407474) | Cod sursa (job #1647010) | Cod sursa (job #2864541) | Cod sursa (job #900696) | Cod sursa (job #2744093)
#include <bits/stdc++.h>
using namespace std;
ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");
//ifstream fin ("loto.in");
//ofstream fout ("loto.out");
unordered_map <int,int> mapp;
int main()
{
int n,x,y;
fin>>n;
for(int i=0;i<n;++i)
{
fin>>x>>y;
if(x==1 and mapp.find(y) == mapp.end())
{
mapp[y] =1;
}
else if(x==2)
{
mapp.erase(y);
}
else if(x==3 )
{
if( mapp.find(y) != mapp.end())
fout<<1<<"\n";
else
fout<<0<<"\n";
}
}
return 0;
}
/*
int main()
{
int n,s,i,x, it;
fin>>n>>s;
fin>>x;
mapp[x]=6;
for(i=2;i<=n;i++)
{
fin>>x;
mapp[x] =0;
}
for(auto it: mapp)
{
cout<<it.first<<": "<<it.second<<"\n";
}
return 0;
}
*/