Pagini recente » Cod sursa (job #1441950) | Cod sursa (job #2910799) | Cod sursa (job #159457) | Cod sursa (job #1412351) | Cod sursa (job #3269227)
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n, op, x;
unordered_map <int, bool> m;
int main()
{
f >> n;
while (n--) {
f >> op >> x;
if (op == 1) {
if (m.find(x) == m.end()) {
m[x] = 1;
}
}
else if (op == 2) {
if (m.find(x) != m.end()) {
m.erase(x);
}
}
else {
g << (m.find(x) != m.end()) << '\n';
}
}
return 0;
}