#pragma once #include using namespace std; template struct sorted_set : vector { typename vector::iterator begin() { return vector::begin(); } typename vector::iterator end() { return vector::end(); } typename vector::const_iterator begin() const { return vector::begin(); } typename vector::const_iterator end() const { return vector::end(); } typename vector::const_iterator lower_bound(const T& x) const { return ::lower_bound(begin(), end(), x); } void insert(const T& x) { auto it = lower_bound(x); if (it == end() || it->t != x.t) { vector::insert(it, x); } } void erase(const T& x) { auto it = lower_bound(x); if (it != end() && it->t == x.t) { vector::erase(it); } } bool empty() const { return vector::empty(); } };