fork(1) download
  1. #include <bits/stdc++.h>
  2. #include <ext/pb_ds/assoc_container.hpp>
  3. #include <ext/pb_ds/tree_policy.hpp>
  4.  
  5. using namespace std ;
  6. using namespace __gnu_pbds;
  7.  
  8. typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
  9.  
  10. signed main(){
  11. ordered_set s ;
  12. s.insert(0) ;
  13. s.insert(0) ;
  14. s.insert(0) ;
  15. s.insert(0) ;
  16. cout << int(s.size()) << endl ;
  17. s.erase(s.find(0)) ;
  18. cout << int(s.size()) << endl ;
  19.  
  20. }
Success #stdin #stdout 0s 4876KB
stdin
Standard input is empty
stdout
4
4