Pagini recente » Cod sursa (job #1274017) | Cod sursa (job #1634224) | Cod sursa (job #2904623) | Cod sursa (job #2463477) | Cod sursa (job #2624999)
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
int main()
{
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n, nr;
map <int, int> m;
int i, tip, x;
f>>n;
for (i=1; i<=n; i++)
{
f>>tip>>x;
if (tip == 1 && m.find(x) == m.end())
m[x] = ++nr;
if (tip == 2)
m.erase(x);
if (tip == 3)
if (m.find(x) != m.end())
cout<<1<<"\n";
else
cout<<0<<"\n";
}
return 0;
}