Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <set>
- using namespace std;
- int main() {
- int q;
- cin >> q;
- set<int> st;
- for(int i = 0; i < q; i++) {
- int x, y;
- cin >> x >> y;
- if(x == 1) {
- st.insert(y);
- }
- else if(x == 2) {
- if(st.count(y)) {
- st.erase(y);
- }
- }
- else {
- if(st.count(y)) {
- cout << "Yes\n";
- }
- else {
- cout << "No\n";
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment