There are a number of blogs which describe the implementation of ordered_set using Fenwick trees.
Is there any way to implement fenwick tree struct using ordered_set? And could that be extended to the 2D case?
Motivation: I really suck at fenwick trees, and always get around by segtree templates... So, I'm trying to find a way to solve when I don't have access to templates... :(