Pagini recente » Cod sursa (job #7688) | Cod sursa (job #1664656) | Monitorul de evaluare | Cod sursa (job #1509744) | Cod sursa (job #2628084)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main()
{
int n;
int op,x;
unordered_set<int> hT;
fin>>n;
for(int i=1;i<=n;i++)
{
fin>>op>>x;
if(op==1 && hT.find(x)==hT.end()) hT.insert(x);
else if(op==2 && hT.find(x)!=hT.end()) hT.erase(x);
else if(op==3){
if(hT.find(x)!=hT.end()) fout<<"1\n";
else fout<<"0\n";
}
}
return 0;
}