Problem prefixsums
User yongteckrice
Submission Time 2023-02-14 08:26:17
Score 0
Max Time N/A
Max Memory N/A

Compile Error

prefixsums.cpp: In function ‘int main()’:
prefixsums.cpp:14:5: error: invalid types ‘long int[int]’ for array subscript
14 | N[0] = tempex;
| ^
prefixsums.cpp:19:6: error: invalid types ‘long int[long int]’ for array subscript
19 | N[i] = temp + N[i-1];
| ^
prefixsums.cpp:19:22: error: invalid types ‘long int[long int]’ for array subscript
19 | N[i] = temp + N[i-1];
| ^
prefixsums.cpp:26:3: error: ‘answer’ was not declared in this scope; did you mean ‘answers’?
26 | answer[i] = prefix[p2] - prefix[p1-1];
| ^~~~~~
| answers
prefixsums.cpp:29:15: error: ‘answer’ was not declared in this scope; did you mean ‘answers’?
29 | for (auto i: answer)
| ^~~~~~
| answers