Pagini recente » Cod sursa (job #2953694) | Cod sursa (job #729610) | Cod sursa (job #2286812) | Cod sursa (job #1716215) | Cod sursa (job #2622224)
#include <fstream>
#include <unordered_map>
using namespace std;
int main() {
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
unordered_map<int, int> map;
int i, op, x, n, nr = 0;
fin >> n;
for(i = 0; i < n; i++) {
fin >> op >> x;
if(op == 1 && map.find(x) == map.end()) {
map[x] = ++nr;
}
if(op == 2) {
map.erase(x);
}
if(op == 3) {
fout << (map.find(x) != map.end()) << endl;
}
}
return 0;
}