Pagini recente » Cod sursa (job #399573) | Cod sursa (job #253686) | Cod sursa (job #1270137) | Cod sursa (job #404378) | Cod sursa (job #1126334)
#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 = 1; 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;
}