Skip to content

Commit

Permalink
Update black_magic.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
i1011 authored Oct 15, 2023
1 parent 4794219 commit 07b92c9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions codebook/1_Basic/black_magic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ int main() {
h1.join(h2); // h1 = {1, 2, 3, 4}, h2 = {};
tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> st;
tree<ll, ll, less<ll>, rb_tree_tag, tree_order_statistics_node_update> mp;
for (int x : {0, 2, 3, 4}) st.insert(x);
cout << *st.find_by_order(2) << st.order_of_key(1) << endl; //31
for (int x : {0, 3, 20, 50}) st.insert(x);
assert(st.order_of_key(3) == 1 && st.order_of_key(4) == 2);
assert(*st.find_by_order(2) == 20 && *st.lower_bound(4) == 20);
rope<char> *root[10]; // nsqrt(n)
root[0] = new rope<char>();
root[1] = new rope<char>(*root[0]);
Expand Down

0 comments on commit 07b92c9

Please sign in to comment.