| 2 | int n; vi data; |
| 3 | fenwick_tree(int _n) : n(_n), data(vi(n)) { } |
| 4 | void update(int at, int by) { |
| 5 | while (at < n) data[at] += by, at |= at + 1; } |
| 6 | int query(int at) { |
| 7 | int res = 0; |
| 8 | while (at >= 0) res += data[at], at = (at & (at + 1)) - 1; |
no outgoing calls
no test coverage detected