Pagini recente » Cod sursa (job #1068312) | Cod sursa (job #1451212) | Cod sursa (job #1944658) | Cod sursa (job #2691329) | Cod sursa (job #3129369)
#include <iostream>
#include <unordered_map>
#include <fstream>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int main()
{
int n;
int aux, aux2;
f >> n;
unordered_map<int, int> h;
while (f >> aux >> aux2) {
switch (aux) {
case 1:
if (!h.count(aux2)) {
h[aux2] = 1;
}
break;
case 2:
h.erase(aux2);
break;
case 3:
g << h.count(aux2) << endl;
break;
}
}
f.close();
g.close();
return 0;
}