Pagini recente » Cod sursa (job #2761984) | Cod sursa (job #1965016) | Cod sursa (job #2802408) | Cod sursa (job #2096666) | Cod sursa (job #2181404)
#include <iostream>
#include <map>
#include <fstream>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n,op,elem,curent;
map<int,int>Ma;
int main()
{
f>>n;
while (n--)
{
f>>op>>elem;
if (op==1&&Ma.find(elem)==Ma.end())
Ma[elem]=++curent;
else if (op==2)
Ma.erase(elem);
else
g<<(Ma.find(elem)!=Ma.end())<<'\n';
}
return 0;
}