Jeremiah_

Imprimir

Jun 1st, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.53 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #include <ext/pb_ds/assoc_container.hpp>
  3.  
  4. #define all(a) a.begin(), a.end()
  5. #define forn(l, r) for(int i = l; i < (r); ++i)
  6. #define F first
  7. #define S second
  8. #define $ ios::sync_with_stdio(0);
  9. // #define int long long int
  10.  
  11. using namespace std;
  12. using namespace __gnu_pbds;
  13. using ll = long long int;
  14. using ii = pair<int, int>;
  15. using li = pair<ll, int>;
  16. using vi = vector<int>;
  17. using graph = vector<vi>;
  18. using ordered_set = tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>;
  19.  
  20. /*
  21.  
  22.     ordered_set X;
  23.     X.insert(1);
  24.     X.insert(2);
  25.     X.insert(4);
  26.     X.insert(8);
  27.     X.insert(16);
  28.  
  29.     cout<<*X.find_by_order(1)<<endl; // 2
  30.     cout<<*X.find_by_order(2)<<endl; // 4
  31.     cout<<*X.find_by_order(4)<<endl; // 16
  32.     cout<<(end(X)==X.find_by_order(6))<<endl; // true
  33.  
  34.     // POSIÇÃO DA CHAVE X.LOWER_BOUND(A)
  35.     cout<<X.order_of_key(-5)<<endl;  // 0
  36.     cout<<X.order_of_key(1)<<endl;   // 0
  37.     cout<<X.order_of_key(3)<<endl;   // 2
  38.     cout<<X.order_of_key(4)<<endl;   // 2
  39.     cout<<X.order_of_key(400)<<endl; // 5
  40.  
  41.     ORDERED MULTISET
  42.  
  43.     int t = 0;
  44.  
  45.     ordered_set me;
  46.     me.insert({x, t++});
  47.     me.erase(me.lower_bound({x, 0}));
  48.     cout << me.order_of_key({x, 0}) << "\n";
  49. */
  50.  
  51. mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  52.  
  53. const ll mod =  1000000007;
  54. const int INF = 0x3f3f3f3f;
  55. const int MAXN = 112345;
  56. // const double pi = 3.14159265359;
  57. const double eps = 0.00000001;
  58.  
  59.  
  60. int32_t main() {
  61.     $
  62.    
  63. }
Advertisement
Add Comment
Please, Sign In to add comment