Skip to content

Commit 3c5263c

Browse files
committed
format
1 parent f4afe7c commit 3c5263c

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ struct kth_smallest {
2020
//! @space O(log(maxv - minv)) for recursion stack; no
2121
//! new nodes are allocated
2222
int query(int l, int r, int k) {
23-
return query(k, pst.root_l, pst.root_r,
24-
pst.roots[l], pst.roots[r]);
23+
return query(k, pst.root_l, pst.root_r, pst.roots[l],
24+
pst.roots[r]);
2525
}
2626
int query(int k, int tl, int tr, int vl, int vr) {
2727
if (tr - tl == 1) return tl;
@@ -31,7 +31,7 @@ struct kth_smallest {
3131
if (left_count >= k)
3232
return query(k, tl, tm, pst.tree[vl].lch,
3333
pst.tree[vr].lch);
34-
return query(k - left_count, tm, tr,
35-
pst.tree[vl].rch, pst.tree[vr].rch);
34+
return query(k - left_count, tm, tr, pst.tree[vl].rch,
35+
pst.tree[vr].rch);
3636
}
3737
};

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ struct merge_sort_tree {
1616
int query(int l, int r, int vl, int vr) {
1717
return query(l, r, vl, vr, 0, n, 1);
1818
}
19-
int query(int l, int r, int vl, int vr, int tl,
20-
int tr, int v) {
19+
int query(int l, int r, int vl, int vr, int tl, int tr,
20+
int v) {
2121
if (r <= tl || tr <= l) return 0;
2222
if (l <= tl && tr <= r)
2323
return ranges::lower_bound(tree[v], vr) -

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,25 @@ struct PST {
2222
root_l(root_l), root_r(root_r), roots(1),
2323
tree(1, {0LL, 0, 0}) {}
2424
void update(int idx, ll change, int version) {
25-
roots.push_back(update(idx, change, root_l,
26-
root_r, roots[version]));
25+
roots.push_back(
26+
update(idx, change, root_l, root_r, roots[version]));
2727
}
28-
int update(int idx, ll change, int tl, int tr,
29-
int v) {
28+
int update(int idx, ll change, int tl, int tr, int v) {
3029
if (tr - tl == 1) {
3130
tree.emplace_back(tree[v].sum + change, 0, 0);
3231
return sz(tree) - 1;
3332
}
3433
int tm = tl + (tr - tl) / 2;
3534
int lch = tree[v].lch;
3635
int rch = tree[v].rch;
37-
if (idx < tm)
38-
lch = update(idx, change, tl, tm, lch);
36+
if (idx < tm) lch = update(idx, change, tl, tm, lch);
3937
else rch = update(idx, change, tm, tr, rch);
4038
tree.emplace_back(tree[lch].sum + tree[rch].sum, lch,
4139
rch);
4240
return sz(tree) - 1;
4341
}
4442
ll query(int l, int r, int version) { // [l, r)
45-
return query(l, r, root_l, root_r,
46-
roots[version]);
43+
return query(l, r, root_l, root_r, roots[version]);
4744
}
4845
ll query(int l, int r, int tl, int tr, int v) {
4946
if (v == 0 || r <= tl || tr <= l) return 0;

0 commit comments

Comments
 (0)