Pagini recente » Cod sursa (job #1082537) | Cod sursa (job #2555312) | Cod sursa (job #2972761) | Cod sursa (job #1605606) | Cod sursa (job #1076323)
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main()
{
int N, op, el, nr = 0;
map<int, int> Map;
fin >> N;
for(int i = 0; i < N; i++){
fin >> op >> el;
if(op == 1 && Map.find(el) == Map.end()) {
Map[el] = ++nr;
}
if(op == 2) {
Map.erase(el);
}
if(op == 3) {
fout << (Map.find(el) != Map.end()) << endl;
}
}
return 0;
}