Skip to content

Instantly share code, notes, and snippets.

View kyaryunha's full-sized avatar
🐶
🐾 📏

Shin Hyun kyaryunha

🐶
🐾 📏
View GitHub Profile
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 {