Skip to content

Commit 3810baa

Browse files
authored
Refactor query functions in bit.hpp
1 parent afbf7bd commit 3810baa

File tree

1 file changed

+2
-2
lines changed
  • library/data_structures_[l,r]

1 file changed

+2
-2
lines changed

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"

0 commit comments

Comments
 (0)