Skip to content

Commit 3afb8b7

Browse files
lrvideckisweb-flow
andauthored
Remove some docs (#171)
* remove * Update lazy_seg_tree.hpp * Update rmq.hpp * Update seg_tree.hpp * Fix typo in comment for walk function * Remove comments from update and query functions * Update persistent.hpp * Refactor query functions in bit.hpp * Refactor query method to improve readability * Remove comments from update and query methods * Refactor idx function in linear_rmq.hpp * Fix formatting of query function in rmq.hpp * Refactor query function in seg_tree.hpp Fix formatting and improve query function readability. * [auto-verifier] verify commit 7718bf6 * format --------- Co-authored-by: GitHub <noreply@github.com>
1 parent 421ea33 commit 3afb8b7

File tree

13 files changed

+16
-162
lines changed

13 files changed

+16
-162
lines changed

.verify-helper/timestamps.remote.json

Lines changed: 0 additions & 144 deletions
This file was deleted.

library/data_structures_[l,r)/bit.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ struct BIT {
99
void update(int i, ll d) {
1010
for (; i < sz(s); i |= i + 1) s[i] += d;
1111
}
12-
ll query(int r) { // [0, r)
12+
ll query(int r) {
1313
ll ret = 0;
1414
for (; r > 0; r &= r - 1) ret += s[r - 1];
1515
return ret;
1616
}
17-
ll query(int l, int r) { // [l, r)
18-
return query(r) - query(l);
19-
}
17+
ll query(int l, int r) { return query(r) - query(l); }
2018
#include "bit_uncommon/walk.hpp"
2119
};

library/data_structures_[l,r)/bit_uncommon/walk.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! Requires sum of [i,i] >= 0
2-
//! Returns min r st sum of [0,r] >= sum
2+
//! Returns min r s.t. sum of [0,r] >= sum
33
//! Returns n if sum of [0,n-1] < sum
44
int walk(ll sum) {
55
if (sum <= 0) return -1;

library/data_structures_[l,r)/lazy_seg_tree.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ struct seg_tree {
2222
lazy[v] = 0;
2323
}
2424
}
25-
void update(int l, int r, ll change) { // [l, r)
25+
void update(int l, int r, ll change) {
2626
update(l, r, change, 0, n, 1);
2727
}
2828
void update(int l, int r, ll change, int tl, int tr,
@@ -36,7 +36,7 @@ struct seg_tree {
3636
update(l, r, change, tm, tr, 2 * v + 1);
3737
tree[v] = op(tree[2 * v], tree[2 * v + 1]);
3838
}
39-
ll query(int l, int r) { // [l, r)
39+
ll query(int l, int r) {
4040
return query(l, r, 0, n, 1);
4141
}
4242
ll query(int l, int r, int tl, int tr, int v) {

library/data_structures_[l,r)/rmq.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ template<class T, class F> struct RMQ {
2121
begin(dp[i + 1]), op);
2222
}
2323
}
24-
T query(int l, int r) { // [l, r)
24+
T query(int l, int r) {
2525
assert(l < r);
2626
int lg = __lg(r - l);
2727
return op(dp[lg][l], dp[lg][r - (1 << lg)]);

library/data_structures_[l,r)/seg_tree.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ template<class T, class F> struct tree {
1919
for (s[i += n] = val; i /= 2;)
2020
s[i] = op(s[2 * i], s[2 * i + 1]);
2121
}
22-
T query(int l, int r) { // [l, r)
22+
T query(int l, int r) {
2323
T x = unit, y = unit;
2424
for (l += n, r += n; l < r; l /= 2, r /= 2) {
2525
if (l % 2) x = op(x, s[l++]);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ template<int N> struct implicit_seg_tree {
3535
tree[v].lazy = 0;
3636
}
3737
}
38-
void update(int l, int r, ll add) { // [l, r)
38+
void update(int l, int r, ll add) {
3939
update(l, r, add, root_l, root_r, 0);
4040
}
4141
void update(int l, int r, ll add, int tl, int tr,
@@ -49,7 +49,7 @@ template<int N> struct implicit_seg_tree {
4949
tree[v].num =
5050
op(tree[tree[v].lch].num, tree[tree[v].rch].num);
5151
}
52-
dt query(int l, int r) { // [l, r)
52+
dt query(int l, int r) {
5353
return query(l, r, root_l, root_r, 0);
5454
}
5555
dt query(int l, int r, int tl, int tr, int v) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct PST {
3939
rch);
4040
return sz(tree) - 1;
4141
}
42-
ll query(int l, int r, int version) { // [l, r)
42+
ll query(int l, int r, int version) {
4343
return query(l, r, root_l, root_r, roots[version]);
4444
}
4545
ll query(int l, int r, int tl, int tr, int v) {

library/data_structures_[l,r]/bit.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ struct BIT {
99
void update(int i, ll d) {
1010
for (; i < sz(s); i |= i + 1) s[i] += d;
1111
}
12-
ll query(int i) { // [0, i]
12+
ll query(int i) {
1313
ll ret = 0;
1414
for (; i >= 0; (i &= i + 1)--) ret += s[i];
1515
return ret;
1616
}
17-
ll query(int l, int r) { // [l, r]
17+
ll query(int l, int r) {
1818
return query(r) - query(l - 1);
1919
}
2020
#include "../data_structures_[l,r)/bit_uncommon/walk.hpp"

library/data_structures_[l,r]/disjoint_rmq.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ template<class T, class F> struct disjoint_rmq {
2525
}
2626
}
2727
}
28-
T query(int l, int r) { // [l, r]
28+
T query(int l, int r) {
2929
if (l == r) return dp[0][l];
3030
int lg = __lg(l ^ r);
3131
return op(dp[lg][l], dp[lg][r]);

0 commit comments

Comments
 (0)