Pagini recente » Cod sursa (job #1728715) | Cod sursa (job #1091268) | Cod sursa (job #2709402) | Clasament oitse | Cod sursa (job #1850950)
#include <iostream>
#include <fstream>
#include <map>
#include <stdio.h>
using namespace std;
int n, nr;
map<int, int> M;
int main()
{
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int i, tip, x;
fin>>n;
for(i = 1 ; i <= n ; i++)
{
fin>>tip>>x;
if(tip == 1 && M.find(x) == M.end()) M[x] = ++nr;
if(tip == 2) M.erase(x);
if(tip == 3) {
int ans = (M.find(x) != M.end());
fout<<ans<< "\n";
}
}
fin.close();
fout.close();
return 0;
}