We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent afbf7bd commit 3810baaCopy full SHA for 3810baa
library/data_structures_[l,r]/bit.hpp
@@ -9,12 +9,12 @@ struct BIT {
9
void update(int i, ll d) {
10
for (; i < sz(s); i |= i + 1) s[i] += d;
11
}
12
- ll query(int i) { // [0, i]
+ ll query(int i) {
13
ll ret = 0;
14
for (; i >= 0; (i &= i + 1)--) ret += s[i];
15
return ret;
16
17
- ll query(int l, int r) { // [l, r]
+ ll query(int l, int r) {
18
return query(r) - query(l - 1);
19
20
#include "../data_structures_[l,r)/bit_uncommon/walk.hpp"
0 commit comments