-
Notifications
You must be signed in to change notification settings - Fork 260
Description
I want to append const to several method declarations in atcoder::segtree.
Some complicated DP problems require to maintain two segtrees to improve time complexity. In such situations, coders always have to pay attention to them. If one of them is not modifed at all (used like (disjoint) sparse tables), I want to declare it as const to reduce the risk of updating the wrong segtree.
In current ACL, all atcoder::segtree methods are not declared as const, so we cannot declare the instances as const when there is no update query. On the other hand, it seems that the methods get(), prod(), all_prod(), max_right() and min_left() do not affect any member variables. I suggest that these methods have const like this to enable such usage of atcoder::segtree.
What do you think of this modification?