diff --git a/codebook/1_Basic/black_magic.cpp b/codebook/1_Basic/black_magic.cpp index b0290a2e..54dbb935 100644 --- a/codebook/1_Basic/black_magic.cpp +++ b/codebook/1_Basic/black_magic.cpp @@ -10,8 +10,9 @@ int main() { h1.join(h2); // h1 = {1, 2, 3, 4}, h2 = {}; tree, rb_tree_tag, tree_order_statistics_node_update> st; tree, 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 *root[10]; // nsqrt(n) root[0] = new rope(); root[1] = new rope(*root[0]);