Pagini recente » Cod sursa (job #3195252) | Cod sursa (job #568811) | Cod sursa (job #849254) | Cod sursa (job #2244635) | Cod sursa (job #3131039)
#include <iostream>
#include <unordered_set>
#include <fstream>
using namespace std;
int main() {
unordered_set<int> hash;
int N, op, x;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
f>>N;
for(int i=0;i<N;i++)
{
f>>op>>x;
if(op==1)hash.insert(x);
else if(op==2)hash.erase(x);
else if(op==3)
{
auto it = hash.find(x);
if(it!=hash.end())g<<1<<endl;
else g<<0<<endl;
}
}
}