Advertisement
momo2345

sets stl

Aug 13th, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int t;
  6. cin>>t;
  7. set<int>s;
  8. while(t--)
  9. {
  10. int n,m;
  11. cin>>m>>n;
  12. if(m==1)
  13. s.insert(n);
  14. if(m==2)
  15. s.erase(n);
  16. if(m==3)
  17. {
  18. if(s.count(n)==1) puts("Yes");
  19. else puts("No");
  20. }
  21.  
  22. }
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement