Pagini recente » Cod sursa (job #583862) | Cod sursa (job #1727622) | Monitorul de evaluare | Cod sursa (job #2335377) | Cod sursa (job #1901900)
#include <bits/stdc++.h>
using namespace std;
int n;
map <int,int> hasht;
int main()
{
ifstream in ("hashuri.in");
ofstream out ("hashuri.out");
in >> n;
while (n--)
{
int op, x;
in >> op >> x;
if(op == 1)
++hasht[x];
else if(op == 2)
hasht.erase(x);
else
{
out << (hasht.find(x) != hasht.end()) ? 1 : 0;
out << "\n";
}
}
in.close();
out.close();
return 0;
}