Pagini recente » Cod sursa (job #2467051) | Cod sursa (job #775313) | Cod sursa (job #2512422) | Cod sursa (job #2367238) | Cod sursa (job #2772698)
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
unordered_map<int, bool> Hash;
int n, x, y;
int main() {
ios_base::sync_with_stdio(false);
in.tie(NULL), out.tie(NULL);
in >> n;
for(int i = 1; i <= n; i++) {
in >> x >> y;
if(x == 1) {
Hash[y] = true;
} else if(x == 2) {
Hash.erase(y);
} else if(x == 3) {
out << (Hash.find(y) != Hash.end()) << "\n";
}
}
fin.close();
fout.close();
return 0;
}