Pagini recente » Cod sursa (job #2734741) | Cod sursa (job #1013612) | Cod sursa (job #3131372) | Cod sursa (job #2027280) | Cod sursa (job #1686320)
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
map<int,int> h;
int n,t,x,i;
int main()
{
fin>>n;
for(i=1;i<=n;i++)
{
fin>>t>>x;
if(t==1&&h.find(x)==h.end()) h.insert(make_pair(x,0));
else if(t==2) h.erase(x);
else if(h.find(x)==h.end()) fout<<"0\n";
else fout<<"1\n";
}
return 0;
}