Pagini recente » Cod sursa (job #868079) | Cod sursa (job #3216375) | Rezultatele filtrării | Rezultatele filtrării | Cod sursa (job #1759431)
#include <fstream>
#include <map>
using namespace std;
int main()
{
ifstream f("hashuri.in");
ofstream g("hashuri.out");
map <int, int> m;
int n, tip, x, no=0;
f >> n;
for(int i=1; i<=n; i++)
{
f >> tip >> x;
if(tip==1 && m.find(x)==m.end()) m[x]=++no;
if(tip==2) m.erase(x);
if(tip==3)
{
bool ok;
if(m.find(x) != m.end()) ok=1;
else ok=0;
g << ok << "\n";
}
}
}