Advertisement
sajid161

9:1

Jan 5th, 2021
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. #define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  3. using namespace std;
  4. int main()
  5. {
  6.     optimize();
  7.     int q;
  8.     cin>>q;
  9.     set<int>s;
  10.     while(q--)
  11.     {
  12.         int x,y;
  13.         cin>>x>>y;
  14.         if(x==1)
  15.         {
  16.            s.insert(y);
  17.         }
  18.         else if(x==2)
  19.         {
  20.             s.erase(y);
  21.         }
  22.         else if(x==3)
  23.         {
  24.             if(s.count(y)) cout<<"Yes\n";
  25.             else cout<<"No\n";
  26.         }
  27.     }
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement