Problem prefixsums
User Andrew
Submission Time 2024-10-30 15:07:51
Score 0
Max Time N/A
Max Memory N/A

Compile Error

prefixsums.cpp: In function ‘int main()’:
prefixsums.cpp:4:29: error: ‘i’ was not declared in this scope
4 | int N, Q, A, l, r, sums[i];
| ^
prefixsums.cpp:11:9: error: ‘sums’ was not declared in this scope
11 | sums[i] = 0;
| ^~~~
prefixsums.cpp:14:20: error: ‘endpoints’ was not declared in this scope
14 | for (int j=endpoints[i][0]-1; j<endpoints[i][1]; j++) {
| ^~~~~~~~~
prefixsums.cpp:15:13: error: ‘sums’ was not declared in this scope
15 | sums[i] += A[j];
| ^~~~
prefixsums.cpp:15:27: error: invalid types ‘int[int]’ for array subscript
15 | sums[i] += A[j];
| ^
prefixsums.cpp:17:18: error: ‘sums’ was not declared in this scope
17 | printf("%d\n", sums[i]);
| ^~~~