Pagini recente » Cod sursa (job #3219193) | Cod sursa (job #2671779) | Cod sursa (job #649151) | Cod sursa (job #1770268) | Cod sursa (job #2744078)
#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,i;
fin>>n;
for(i=1;i<=n;++i)
{
fin>>x>>y;
if(x==1 && mapp.count(y)==0)
{
mapp[y] =1;
}
if(x==2)
{
mapp.erase(y);
}
if(x==3 )
{
if( mapp.count(y))
fout<<1;
else
fout<<0;
fout<<"\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;
}
*/