Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
- using namespace std;
- int main()
- {
- optimize();
- int q;
- cin>>q;
- set<int>s;
- while(q--)
- {
- int x,y;
- cin>>x>>y;
- if(x==1)
- {
- s.insert(y);
- }
- else if(x==2)
- {
- s.erase(y);
- }
- else if(x==3)
- {
- if(s.count(y)) cout<<"Yes\n";
- else cout<<"No\n";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement