Pagini recente » Cod sursa (job #2151242) | Cod sursa (job #2154572) | Cod sursa (job #1659786) | Cod sursa (job #1226356) | Cod sursa (job #2773550)
#include <iostream>
#include <fstream>
#include <unordered_set>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
unordered_set<int> hashSet;
int main()
{
int n;
int operatie, x;
fin>>n;
for(int i = 1;i<=n;++i){
fin>>operatie>>x;
if(operatie == 1){
hashSet.insert(x);
}
else if(operatie == 2){
hashSet.erase(x);
}
else{
if(hashSet.find(x) == hashSet.end()){
fout<<0<<"\n";
}
else fout<<1<<"\n";
}
}
return 0;
}