Pagini recente » Cod sursa (job #1225726) | Cod sursa (job #767196) | Cod sursa (job #1180676) | Cod sursa (job #1781826) | Cod sursa (job #1243700)
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
ifstream f ("hashuri.in");
ofstream g ("hashuri.out");
const int NMAX = 1000000;
int n;
map <int, int> M;
void rezolva() {
int tip, x, id = 0;
while (n--) {
f >> tip >> x;
if (tip == 1) {
if (M.find(x) == M.end()) M[x] = ++id;
}
else if (tip == 2) M.erase(x);
else if (tip == 3) g << (M.find(x) != M.end()) << '\n';
}
}
int main() {
f >> n;
rezolva();
return 0;
}