Pagini recente » Cod sursa (job #2219820) | Cod sursa (job #2820365) | Cod sursa (job #991531) | Cod sursa (job #3357493) | Cod sursa (job #1777996)
#include <fstream>
#include <map>
using namespace std;
unsigned int N;
unsigned short int op;
unsigned int x;
map < unsigned int, unsigned int > M;
unsigned int i, NR;
int main ()
{
ifstream fin ("hashuri.in");
fin >> N;
ofstream fout ("hashuri.out");
for (i=1; i<=N; i++)
{
fin >> op >> x;
if (op == 1 && M.find(x)==M.end())
{
NR++;
M[x] = NR;
}
else if (op == 2)
M.erase(x);
else
fout << (M.find(x)!=M.end()) << '\n';
}
fin.close();
fout.close();
return 0;
}