Pagini recente » Cod sursa (job #264399) | Cod sursa (job #475188) | Cod sursa (job #991105) | Cod sursa (job #1115513) | 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;
}