You are viewing a single comment's thread. Return to all comments →
using namespace std;
int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int queries; cin >> queries; cin.ignore();
set<int> s; for (int i = 0; i < queries; i++) { int type, num; cin >> type >> num; auto it = s.find(num); switch (type) { case 1: s.insert(num); break; case 2: s.erase(num); break; case 3: if (it != s.end() && *it == num) { cout << "Yes" << endl; } else { cout << "No" << endl; } break; default: break; } } return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Sets-STL
You are viewing a single comment's thread. Return to all comments →
include
include
include
include
using namespace std;
int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */
int queries; cin >> queries; cin.ignore();
}