Pagini recente » Cod sursa (job #402424) | Cod sursa (job #2564703) | Cod sursa (job #1791028) | Cod sursa (job #806419) | Cod sursa (job #956692)
Cod sursa(job #956692)
#include <fstream>
#include <map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
map < int, int > H;
int main()
{
int n, nr=0, tip, x; f>>n;
for (int i=1; i<=n; i++)
{
f>>tip>>x;
if (tip==1 && H.find(x)==H.end()) H[x]=++nr;
if (tip==2) H.erase(x);
if (tip==3)
{
bool ok=H.find(x)!=H.end();
g<<ok<<'\n';
}
}
return 0;
}