Problem fenwicktree
User wrizz69
Submission Time 2023-11-10 10:58:07
Score 0
Max Time N/A
Max Memory N/A

Compile Error

fenwicktree.cpp: In function ‘int main()’:
fenwicktree.cpp:21:10: error: ‘sum’ was not declared in this scope
21 | return sum;
| ^~~
fenwicktree.cpp: In function ‘long long int query(long long int, long long int)’:
fenwicktree.cpp:34:23: error: ‘e’ was not declared in this scope
34 | for (; y > 0; e -= lsb(y)) sum += ft[y];
| ^
fenwicktree.cpp:34:43: error: ‘ft’ was not declared in this scope
34 | for (; y > 0; e -= lsb(y)) sum += ft[y];
| ^~
fenwicktree.cpp:35:43: error: ‘ft’ was not declared in this scope
35 | for (; x > 0; x -= lsb(x)) sum -= ft[x];
| ^~
fenwicktree.cpp: In function ‘void update(long long int, long long int)’:
fenwicktree.cpp:39:21: error: ‘n’ was not declared in this scope
39 | for (; p <= n + 1; p += lsb(p)) ft[p] += v;<