Skip to content

Commit ace8fc1

Browse files
committed
refactor
1 parent a585b6d commit ace8fc1

File tree

1 file changed

+5
-5
lines changed
  • library/data_structures_[l,r)/seg_tree_uncommon

1 file changed

+5
-5
lines changed

library/data_structures_[l,r)/seg_tree_uncommon/kd_tree.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ template<int K> struct KD_SEG {
1111
s[i += n].update(a...);
1212
while (i /= 2) s[i].pull(s[2 * i], s[2 * i + 1], a...);
1313
}
14+
void pull(const KD_SEG<K>& l, const KD_SEG<K>& r, int i,
15+
auto... a) {
16+
s[i += n].pull(l.s[i], r.s[i], a...);
17+
while (i /= 2) s[i].pull(s[2 * i], s[2 * i + 1], a...);
18+
}
1419
T query(int l, int r, auto... a) {
1520
T x = unit, y = unit;
1621
for (l += n, r += n; l < r; l /= 2, r /= 2) {
@@ -19,11 +24,6 @@ template<int K> struct KD_SEG {
1924
}
2025
return op(x, y);
2126
}
22-
void pull(const KD_SEG<K>& l, const KD_SEG<K>& r, int i,
23-
auto... a) {
24-
s[i += n].pull(l.s[i], r.s[i], a...);
25-
while (i /= 2) s[i].pull(s[2 * i], s[2 * i + 1], a...);
26-
}
2727
};
2828
template<> struct KD_SEG<0> {
2929
T val = unit;

0 commit comments

Comments
 (0)