Pagini recente » Rating Dragos Serenus (Xpoizon) | Cod sursa (job #2001255) | Cod sursa (job #155161) | Cod sursa (job #341079) | Cod sursa (job #1524971)
#include <map>
#include<fstream>
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) fout<<(M.find(x) != M.end())<<endl;
}
return 0;
}