Advertisement
Guest User

Untitled

a guest
Dec 20th, 2020
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  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<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
  9.  
  10. signed main(){
  11.     int id = 0;
  12.     ordered_set s;
  13.     s.insert({0, id++});
  14.     s.insert({0, id++});
  15.     s.insert({0, id++});
  16.     s.insert({0, id++});
  17.     cout << int(s.size()) << endl;
  18.     s.erase(s.lower_bound(make_pair(0, -1)));
  19.     cout << int(s.size()) << endl;
  20.  
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement