Pagini recente » Cod sursa (job #2848071) | Cod sursa (job #1726046) | Cod sursa (job #1793088) | Cod sursa (job #1344539) | Cod sursa (job #1641440)
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int x, nrquiz, type;
unordered_map < int, int > m;
int main()
{
f >> nrquiz;
while (nrquiz)
{
nrquiz --;
f >> type >> x;
if (type == 1)
m[x] ++;
if (type == 2)
m.erase(x);
if (type == 3)
g << (m.find(x) != m.end()) << '\n';
}
return 0;
}