Pagini recente » Cod sursa (job #620106) | Cod sursa (job #1710025) | Cod sursa (job #1270616) | Cod sursa (job #2953280) | Cod sursa (job #1126325)
#include <fstream>
#include <map>
using namespace std;
int n, nr;
map <int, int> M;
int main()
{
fstream in("hashuri.in", ios::in);
fstream out("hashuri.out", ios::out);
int i, tip, x;
in >> n;
for (i = 0; i < n; ++i) {
in >> tip >> x;
if (tip == 1 && M.find(x)==M.end()) {
M[x] = ++nr;
}
if (tip == 2) {
M.erase(x);
}
if (tip == 3) {
out << (M.find(x) != M.end());
}
}
return 0;
}