Pagini recente » Cod sursa (job #2724564) | Cod sursa (job #784331) | Cod sursa (job #1731598) | Cod sursa (job #1231336) | Cod sursa (job #1774485)
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
int main() {
ifstream cin("hashuri.in");
ofstream cout("hashuri.out");
map<unsigned int, bool> h;
unsigned n, op, x;
cin>>n;
for (int i = 0; i < n; i++) {
cin>>op>>x;
if (op == 1) {
h[x] = true;
} else if (op == 2) {
if (h.find(x) != h.end()) {
h.erase(h.find(x));
}
} else {
cout<<(h.find(x)!=h.end())<<"\n";
}
}
}