Skip to content

Commit 679ef86

Browse files
committed
nits
1 parent 47e92f6 commit 679ef86

File tree

1 file changed

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

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ template<int K> struct KD_SEG {
77
vector<KD_SEG<K - 1>> s;
88
KD_SEG(int n, auto... a):
99
n(n), s(2 * n, KD_SEG<K - 1>(a...)) {}
10-
void update(int p, auto... a) {
11-
s[p += n].update(a...);
12-
while (p /= 2) s[p].pull(s[2 * p], s[2 * p + 1], a...);
10+
void update(int i, auto... a) {
11+
s[i += n].update(a...);
12+
while (i /= 2) s[i].pull(s[2 * i], s[2 * i + 1], a...);
1313
}
1414
T query(int l, int r, auto... a) {
1515
T x = unit, y = unit;
@@ -19,18 +19,18 @@ template<int K> struct KD_SEG {
1919
}
2020
return op(x, y);
2121
}
22-
void pull(const KD_SEG<K>& left, const KD_SEG<K>& right,
23-
int p, auto... a) {
24-
s[p += n].pull(left.s[p], right.s[p], a...);
25-
while (p /= 2) s[p].pull(s[2 * p], s[2 * p + 1], a...);
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...);
2626
}
2727
};
2828
template<> struct KD_SEG<0> {
2929
T val = unit;
3030
void update(T v) { val = v; }
3131
T query() { return val; }
32-
void pull(const KD_SEG<0>& left, const KD_SEG<0>& right,
32+
void pull(const KD_SEG<0>& l, const KD_SEG<0>& r,
3333
auto...) {
34-
val = op(left.val, right.val);
34+
val = op(l.val, r.val);
3535
}
3636
};

0 commit comments

Comments
 (0)