Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 0 additions & 144 deletions .verify-helper/timestamps.remote.json

This file was deleted.

6 changes: 2 additions & 4 deletions library/data_structures_[l,r)/bit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ struct BIT {
void update(int i, ll d) {
for (; i < sz(s); i |= i + 1) s[i] += d;
}
ll query(int r) { // [0, r)
ll query(int r) {
ll ret = 0;
for (; r > 0; r &= r - 1) ret += s[r - 1];
return ret;
}
ll query(int l, int r) { // [l, r)
return query(r) - query(l);
}
ll query(int l, int r) { return query(r) - query(l); }
#include "bit_uncommon/walk.hpp"
};
2 changes: 1 addition & 1 deletion library/data_structures_[l,r)/bit_uncommon/walk.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Requires sum of [i,i] >= 0
//! Returns min r st sum of [0,r] >= sum
//! Returns min r s.t. sum of [0,r] >= sum
//! Returns n if sum of [0,n-1] < sum
int walk(ll sum) {
if (sum <= 0) return -1;
Expand Down
4 changes: 2 additions & 2 deletions library/data_structures_[l,r)/lazy_seg_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct seg_tree {
lazy[v] = 0;
}
}
void update(int l, int r, ll change) { // [l, r)
void update(int l, int r, ll change) {
update(l, r, change, 0, n, 1);
}
void update(int l, int r, ll change, int tl, int tr,
Expand All @@ -36,7 +36,7 @@ struct seg_tree {
update(l, r, change, tm, tr, 2 * v + 1);
tree[v] = op(tree[2 * v], tree[2 * v + 1]);
}
ll query(int l, int r) { // [l, r)
ll query(int l, int r) {
return query(l, r, 0, n, 1);
}
ll query(int l, int r, int tl, int tr, int v) {
Expand Down
2 changes: 1 addition & 1 deletion library/data_structures_[l,r)/rmq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ template<class T, class F> struct RMQ {
begin(dp[i + 1]), op);
}
}
T query(int l, int r) { // [l, r)
T query(int l, int r) {
assert(l < r);
int lg = __lg(r - l);
return op(dp[lg][l], dp[lg][r - (1 << lg)]);
Expand Down
2 changes: 1 addition & 1 deletion library/data_structures_[l,r)/seg_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ template<class T, class F> struct tree {
for (s[i += n] = val; i /= 2;)
s[i] = op(s[2 * i], s[2 * i + 1]);
}
T query(int l, int r) { // [l, r)
T query(int l, int r) {
T x = unit, y = unit;
for (l += n, r += n; l < r; l /= 2, r /= 2) {
if (l % 2) x = op(x, s[l++]);
Expand Down
4 changes: 2 additions & 2 deletions library/data_structures_[l,r)/seg_tree_uncommon/implicit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ template<int N> struct implicit_seg_tree {
tree[v].lazy = 0;
}
}
void update(int l, int r, ll add) { // [l, r)
void update(int l, int r, ll add) {
update(l, r, add, root_l, root_r, 0);
}
void update(int l, int r, ll add, int tl, int tr,
Expand All @@ -49,7 +49,7 @@ template<int N> struct implicit_seg_tree {
tree[v].num =
op(tree[tree[v].lch].num, tree[tree[v].rch].num);
}
dt query(int l, int r) { // [l, r)
dt query(int l, int r) {
return query(l, r, root_l, root_r, 0);
}
dt query(int l, int r, int tl, int tr, int v) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct PST {
rch);
return sz(tree) - 1;
}
ll query(int l, int r, int version) { // [l, r)
ll query(int l, int r, int version) {
return query(l, r, root_l, root_r, roots[version]);
}
ll query(int l, int r, int tl, int tr, int v) {
Expand Down
4 changes: 2 additions & 2 deletions library/data_structures_[l,r]/bit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ struct BIT {
void update(int i, ll d) {
for (; i < sz(s); i |= i + 1) s[i] += d;
}
ll query(int i) { // [0, i]
ll query(int i) {
ll ret = 0;
for (; i >= 0; (i &= i + 1)--) ret += s[i];
return ret;
}
ll query(int l, int r) { // [l, r]
ll query(int l, int r) {
return query(r) - query(l - 1);
}
#include "../data_structures_[l,r)/bit_uncommon/walk.hpp"
Expand Down
2 changes: 1 addition & 1 deletion library/data_structures_[l,r]/disjoint_rmq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ template<class T, class F> struct disjoint_rmq {
}
}
}
T query(int l, int r) { // [l, r]
T query(int l, int r) {
if (l == r) return dp[0][l];
int lg = __lg(l ^ r);
return op(dp[lg][l], dp[lg][r]);
Expand Down
2 changes: 1 addition & 1 deletion library/data_structures_[l,r]/linear_rmq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ template<class T, class F> struct linear_rmq {
rep(i, 1, n) asc[i] =
(asc[i] | asc[i - 1]) & -(in[i] & -in[i]);
}
int idx(int l, int r) { // [l, r]
int idx(int l, int r) {
if (unsigned j = in[l] ^ in[r]; j) {
j = asc[l] & asc[r] & -bit_floor(j);
if (unsigned k = asc[l] ^ j; k)
Expand Down
2 changes: 1 addition & 1 deletion library/data_structures_[l,r]/rmq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ template<class T, class F> struct RMQ {
begin(dp[i + 1]), op);
}
}
T query(int l, int r) { // [l, r]
T query(int l, int r) {
assert(l <= r);
int lg = __lg(r - l + 1);
return op(dp[lg][l], dp[lg][r - (1 << lg) + 1]);
Expand Down
2 changes: 1 addition & 1 deletion library/data_structures_[l,r]/seg_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ template<class T, class F> struct tree {
for (s[i += n] = val; i /= 2;)
s[i] = op(s[2 * i], s[2 * i + 1]);
}
T query(int l, int r) { // [l, r]
T query(int l, int r) {
T res = s[nxt(l += n, r += n)];
while (l <= r) res = op(res, s[nxt(l, r)]);
return res;
Expand Down
Loading