Pagini recente » Cod sursa (job #2062375) | Cod sursa (job #1720016) | Cod sursa (job #2322634) | Cod sursa (job #1803711) | Cod sursa (job #2722601)
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n;
unordered_map <int, bool> m;
int main()
{
f >> n;
int x, op;
for(int i = 1; i <= n; ++i) {
f >> op >> x;
if(op == 1)
m[x] = true;
else if(op == 2) {
if(m.find(x) != m.end())
m.erase(m.find(x));
}
else g << (m[x] ? "1\n" : "0\n");
}
}