Заказать дерево статистики, используя __gnu_pbds для мультинабора ⇐ C++
-
Anonymous
Заказать дерево статистики, используя __gnu_pbds для мультинабора
I am trying to implement an order statistics tree with using __gnu__pbds. I followed this code TREE_ORDER_STATISTICS
But, I need this on a multiset. I was suggested to use a pair to implement this feature CODEFORCES COMMENT
//Main idea is to keep pairs like {elem, id}. typedef tree< pair, null_type, less, rb_tree_tag, tree_order_statistics_node_update> ordered_set; int t = 0; ordered_set me; ... me.insert({x, t++}); me.erase(me.lower_bound({x, 0})); cout
Источник: https://stackoverflow.com/questions/442 ... r-multiset
I am trying to implement an order statistics tree with using __gnu__pbds. I followed this code TREE_ORDER_STATISTICS
But, I need this on a multiset. I was suggested to use a pair to implement this feature CODEFORCES COMMENT
//Main idea is to keep pairs like {elem, id}. typedef tree< pair, null_type, less, rb_tree_tag, tree_order_statistics_node_update> ordered_set; int t = 0; ordered_set me; ... me.insert({x, t++}); me.erase(me.lower_bound({x, 0})); cout
Источник: https://stackoverflow.com/questions/442 ... r-multiset
Мобильная версия