Pagini recente » Cod sursa (job #2328395) | Cod sursa (job #1138075) | Cod sursa (job #618231) | Cod sursa (job #2664057) | Cod sursa (job #2702850)
#include <fstream>
#include <map>
#include<unordered_map>
using namespace std;
int main()
{
ifstream be("hashuri.in");
ofstream ki("hashuri.out");
unordered_map<int,int>m;
int n,db=0;
be>>n;
for(int i=1;i<=n;i++)
{
int x,y;
be>>x>>y;
if(x==1 && m.find(y)==m.end()){
m[y]=db++;
}
if(x==2)m.erase(y);
if(x==3)
{
bool c=m.find(y)!=m.end();
ki<<c<<endl;
}
}
return 0;
}