This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename T, const T& Combine(const T&, const T&)> | |
class segment_tree { | |
darray<T> v; | |
T default_value; | |
T combine_considering_default(const T& left_value, const T& right_value) const { | |
if (left_value == default_value) { | |
return right_value; | |
} else if (right_value == default_value) { | |
return left_value; | |
} else { |