Pagini recente » Cod sursa (job #363563) | Cod sursa (job #2134255) | Cod sursa (job #1972520) | Cod sursa (job #1864632) | Cod sursa (job #2434066)
#include <fstream>
#include <unordered_map>
int main() {
std::ifstream cin("hashuri.in");
std::ofstream cout("hashuri.out");
std::ios::sync_with_stdio(false);
int n, op_type, x;
cin >> n;
std::unordered_map<int, int> map;
for (int i = 0 ; i < n ; ++i) {
cin >> op_type >> x;
switch(op_type) {
case 1: if (map.find(x) == map.end()) {
map[x++];
}
break;
case 2: map.erase(x);
break;
default: cout << (map.find(x) != map.end()) << '\n';
}
}
return 0;
}