Problem fenwicktree
User hwy
Submission Time 2023-12-12 12:09:55
Score 0
Max Time N/A
Max Memory N/A

Compile Error

fenwicktree.cpp: In function ‘void build()’:
fenwicktree.cpp:14:18: error: expected ‘;’ before ‘for’
14 | B2.assign(m+1,0)
| ^
| ;
15 | for (int i = 1; i <= m; ++i) {
| ~~~
fenwicktree.cpp:15:18: error: ‘i’ was not declared in this scope
15 | for (int i = 1; i <= m; ++i) {
| ^
fenwicktree.cpp: At global scope:
fenwicktree.cpp:36:28: error: ‘idx’ has not been declared
36 | int sum(vector<int>& vect, idx) {
| ^~~
fenwicktree.cpp: In function ‘int sum(std::vector<int>&, int)’:
fenwicktree.cpp:37:5: error: ‘total’ was not declared in this scope
37 | total = 0;
| ^~~~~
fenwicktree.cpp:38:12: error: ‘idx’ was not declared in this scope
38 | while (idx > 0) {
| ^~~
fenwicktree.cpp: At global scope:
fenwicktree.cpp:45:16: error: ‘id