Pagini recente » Borderou de evaluare (job #1926730) | Borderou de evaluare (job #3151005) | Cod sursa (job #313865) | Cod sursa (job #2772699)
#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";
}
}
in.close();
out.close();
return 0;
}