You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classSmallestInfiniteSet {
public:SmallestInfiniteSet() {
constexprint N = 1000;
for (int i = 1; i <= N; i++) {
s.emplace(i);
}
}
intpopSmallest() {
constint res = *s.begin();
s.erase(s.begin());
return res;
}
voidaddBack(int num) {
s.emplace(num);
}
private:
set<int> s;
};
/** * Your SmallestInfiniteSet object will be instantiated and called as such: * SmallestInfiniteSet* obj = new SmallestInfiniteSet(); * int param_1 = obj->popSmallest(); * obj->addBack(num);*/
constexpr의 사용법, begin의 이터레이터 반환 (역참조), emplace의 내부에서 생성
The text was updated successfully, but these errors were encountered:
constexpr
의 사용법, begin의 이터레이터 반환 (역참조), emplace의 내부에서 생성The text was updated successfully, but these errors were encountered: