Pagini recente » Cod sursa (job #1225192) | Cod sursa (job #2216016) | Cod sursa (job #1448288) | Cod sursa (job #1144141) | Cod sursa (job #3020935)
#include <fstream>
#include <map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n, op, x, cnt;
map<int, int> mp;
int main() {
fin >> n;
for (int i = 1; i <= n; i++) {
fin >> op >> x;
if (op == 1) {
if (mp.find(x) == mp.end())
mp[x] = ++cnt;
} else if (op == 2) {
mp.erase(x);
} else {
fout << (mp.find(x) != mp.end()) << '\n';
}
}
return 0;
}